Small modules config restructure
Changed variables names in every module
This commit is contained in:
1 parent
c1d2e52bf8
commit
c92b90e406
83 files changed
+616
-523
No files matched your search
@@ -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
|
||||
|
||||
Reference in new issue
Block a user