Small modules config restructure

Changed variables names in every module
This commit is contained in:
aloslider committed 2026-10-31 19:48:50 +03:00
1 parent c1d2e52bf8
commit c92b90e406
83 files changed
+616 -523

No files matched your search

@@ -1,15 +1,16 @@
{ config, lib, ... }:
with lib;
let
rootCfg = config.selfhosted.immich;
cfg = rootCfg.ml;
rootCfg = config.selfhosted;
moduleCfg = rootCfg.immich;
cfg = moduleCfg.ml;
domain = config.sops.placeholder."domains/serv";
mailDomain = "${config.selfhosted.mail.stalwart.subdomain}.${domain}";
pocketIdDomain = "${config.selfhosted.pocket-id.subdomain}.${domain}";
mailDomain = "${rootCfg.mail.stalwart.subdomain}.${domain}";
pocketIdDomain = "${rootCfg.pocket-id.subdomain}.${domain}";
smtpUser = "noreply@${domain}";
in
{
config = mkIf rootCfg.enable {
config = mkIf moduleCfg.enable {
sops.templates."immich.env".content = ''
DB_PASSWORD=${config.sops.placeholder."immich/db_password"}
IMMICH_CONFIG_FILE=/app/immich-config.json
@@ -1,9 +1,10 @@
{ config, lib, ... }:
with lib;
let
common = config.selfhosted.common;
rootCfg = config.selfhosted.immich;
cfg = rootCfg.server;
rootCfg = config.selfhosted;
common = rootCfg.common;
moduleCfg = rootCfg.immich;
cfg = moduleCfg.server;
hostDataPath = "${common.dataDir}/immich";
version = "v3.3.5";
in
@@ -19,7 +20,7 @@ in
};
};
config = mkIf rootCfg.enable {
config = mkIf moduleCfg.enable {
virtualisation.oci-containers.containers."${cfg.name}" = {
image = "ghcr.io/immich-app/immich-server:${version}";
ports = [
@@ -28,10 +29,10 @@ in
environmentFiles = [ config.sops.templates."immich.env".path ];
environment = {
IMMICH_VERSION = version;
DB_HOSTNAME = rootCfg.postgresql.name;
DB_DATABASE_NAME = rootCfg.postgresql.db;
DB_USERNAME = rootCfg.postgresql.user;
REDIS_HOSTNAME = rootCfg.redis.name;
DB_HOSTNAME = moduleCfg.postgresql.name;
DB_DATABASE_NAME = moduleCfg.postgresql.db;
DB_USERNAME = moduleCfg.postgresql.user;
REDIS_HOSTNAME = moduleCfg.redis.name;
};
volumes = [
"${hostDataPath}/data:/data"
@@ -48,15 +49,15 @@ in
serviceConfig = {
Restart = lib.mkOverride 90 "always";
};
wantedBy = [ "${common.backend}-${rootCfg.targetName}.target" ];
partOf = [ "${common.backend}-${rootCfg.targetName}.target" ];
wantedBy = [ "${common.backend}-${moduleCfg.targetName}.target" ];
partOf = [ "${common.backend}-${moduleCfg.targetName}.target" ];
requires = [
"${common.backend}-${rootCfg.postgresql.name}.service"
"${common.backend}-${rootCfg.redis.name}.service"
"${common.backend}-${moduleCfg.postgresql.name}.service"
"${common.backend}-${moduleCfg.redis.name}.service"
];
after = [
"${common.backend}-${rootCfg.postgresql.name}.service"
"${common.backend}-${rootCfg.redis.name}.service"
"${common.backend}-${moduleCfg.postgresql.name}.service"
"${common.backend}-${moduleCfg.redis.name}.service"
];
preStart = ''
mkdir -p ${hostDataPath}/data