Skip to content

Commit

Permalink
Remove legacy oci-containers.containers options
Browse files Browse the repository at this point in the history
  • Loading branch information
barrucadu committed Oct 15, 2023
1 parent 4b18a04 commit c957dec
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 45 deletions.
3 changes: 1 addition & 2 deletions shared/bookdb/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ in
};
};

nixfiles.oci-containers.containers.bookdb-db = {
nixfiles.oci-containers.pods.bookdb.containers.db = {
image = "elasticsearch:${cfg.elasticsearchTag}";
environment = {
"http.host" = "0.0.0.0";
Expand All @@ -56,7 +56,6 @@ in
};
ports = [{ host = cfg.elasticsearchPort; inner = 9200; }];
volumes = [{ name = "esdata"; inner = "/usr/share/elasticsearch/data"; }];
volumeSubDir = "bookdb";
};

users.users.bookdb = {
Expand Down
3 changes: 1 addition & 2 deletions shared/bookmarks/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ in
};
};

nixfiles.oci-containers.containers.bookmarks-db = {
nixfiles.oci-containers.pods.bookmarks.containers.db = {
image = "elasticsearch:${cfg.elasticsearchTag}";
environment = {
"http.host" = "0.0.0.0";
Expand All @@ -51,7 +51,6 @@ in
};
ports = [{ host = cfg.elasticsearchPort; inner = 9200; }];
volumes = [{ name = "esdata"; inner = "/usr/share/elasticsearch/data"; }];
volumeSubDir = "bookmarks";
};

nixfiles.backups.scripts.bookmarks = ''
Expand Down
3 changes: 1 addition & 2 deletions shared/oci-containers/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,8 @@ let
volumeSubDir = pod.volumeSubDir;
}
);
podContainers = concatMapAttrs (podName: pod: mapAttrs' (mkPodContainer podName pod) pod.containers) cfg.pods;
in
attrsets.unionOfDisjoint cfg.containers podContainers;
concatMapAttrs (podName: pod: mapAttrs' (mkPodContainer podName pod) pod.containers) cfg.pods;
in
{
imports = [
Expand Down
37 changes: 0 additions & 37 deletions shared/oci-containers/options.nix
Original file line number Diff line number Diff line change
Expand Up @@ -167,43 +167,6 @@ in
'';
};

containers = mkOption {
type = types.attrsOf (types.submodule ({ name, ... }: {
options =
containerOptions //
{
pod = mkOption {
type = types.nullOr types.str;
default = null;
description = mdDoc ''
Pod to attach the container to. This is only valid if using
podman as the backend.
'';
};
network = mkOption {
type = types.nullOr types.str;
default = null;
description = mdDoc ''
Network to attach the container to. This is only valid if using
docker as the backend.
'';
};
volumeSubDir = mkOption {
type = types.str;
default = name;
description = mdDoc ''
Subdirectory of the `''${volumeBaseDir}` to store bind-mounts
under.
'';
};
};
}));
default = { };
description = mdDoc ''
Attrset of container definitions.
'';
};

pods = mkOption {
type = types.attrsOf (types.submodule ({ name, ... }: {
options = {
Expand Down
3 changes: 1 addition & 2 deletions shared/pleroma/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ in
[ "${toString (pkgs.copyPathToStore cfg.faviconPath)}:/var/lib/pleroma/static/favicon.png" ];
};

nixfiles.oci-containers.containers.pleroma-db = {
nixfiles.oci-containers.pods.pleroma.containers.db = {
image = "postgres:${cfg.postgresTag}";
environment = {
"POSTGRES_DB" = "pleroma";
Expand All @@ -89,7 +89,6 @@ in
{ name = "pgdata"; inner = "/var/lib/postgresql/data"; }
{ host = "/var/run/pleroma/db"; inner = "/var/run/postgresql"; }
];
volumeSubDir = "pleroma";
};

# TODO: figure out how to get `sudo` in the unit's path (adding the package
Expand Down

0 comments on commit c957dec

Please sign in to comment.