diff --git a/shared/bookdb/default.nix b/shared/bookdb/default.nix index 856c7ea0..a209e401 100644 --- a/shared/bookdb/default.nix +++ b/shared/bookdb/default.nix @@ -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"; @@ -56,7 +56,6 @@ in }; ports = [{ host = cfg.elasticsearchPort; inner = 9200; }]; volumes = [{ name = "esdata"; inner = "/usr/share/elasticsearch/data"; }]; - volumeSubDir = "bookdb"; }; users.users.bookdb = { diff --git a/shared/bookmarks/default.nix b/shared/bookmarks/default.nix index 4c3458cd..cdfe89f9 100644 --- a/shared/bookmarks/default.nix +++ b/shared/bookmarks/default.nix @@ -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"; @@ -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 = '' diff --git a/shared/oci-containers/default.nix b/shared/oci-containers/default.nix index c11057b2..a3f5c1f2 100644 --- a/shared/oci-containers/default.nix +++ b/shared/oci-containers/default.nix @@ -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 = [ diff --git a/shared/oci-containers/options.nix b/shared/oci-containers/options.nix index b917cebf..333a8cc3 100644 --- a/shared/oci-containers/options.nix +++ b/shared/oci-containers/options.nix @@ -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 = { diff --git a/shared/pleroma/default.nix b/shared/pleroma/default.nix index 103b0df9..9e909a7d 100644 --- a/shared/pleroma/default.nix +++ b/shared/pleroma/default.nix @@ -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"; @@ -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