43 lines
992 B
Nix
43 lines
992 B
Nix
{ config, lib, ... }:
|
|
with lib;
|
|
let
|
|
rootCfg = config.selfhosted;
|
|
common = rootCfg.common;
|
|
moduleCfg = rootCfg.immich;
|
|
in
|
|
{
|
|
imports = [
|
|
./ml
|
|
./postgresql
|
|
./redis
|
|
./server
|
|
];
|
|
|
|
options.selfhosted.immich = {
|
|
enable = mkEnableOption "Enable ${moduleCfg.targetName} root target";
|
|
targetName = mkOption {
|
|
type = types.str;
|
|
};
|
|
subdomain = mkOption {
|
|
type = types.str;
|
|
};
|
|
};
|
|
|
|
config = mkIf moduleCfg.enable {
|
|
sops.secrets = {
|
|
"immich/db_password" = { };
|
|
"immich/client_id" = { };
|
|
"immich/client_secret" = { };
|
|
};
|
|
|
|
systemd.targets."${common.backend}-${moduleCfg.targetName}" = {
|
|
unitConfig = {
|
|
Description = "Root target for ${moduleCfg.targetName}";
|
|
};
|
|
wantedBy = [ "${common.backend}-${common.rootTarget.name}.target" ];
|
|
partOf = [ "${common.backend}-${common.rootTarget.name}.target" ];
|
|
after = [ "${common.backend}-${common.rootTarget.name}.target" ];
|
|
};
|
|
};
|
|
}
|