Files
nix-config/modules/nixos/services/immich/default.nix
2026-04-05 19:10:23 -05:00

43 lines
908 B
Nix
Executable File

{
config,
lib,
namespace,
...
}:
with lib;
let
name = "immich";
cfg = config.${namespace}.services.${name};
net = lib.${namespace}.network;
dbPassword = config.sops.secrets."jallen-nas/immich/db-password".path;
immichConfig = lib.${namespace}.mkModule {
inherit config name;
serviceName = "${name}-server";
description = "immich";
options = { };
moduleConfig = {
# Enable immich service
services.immich = {
inherit (cfg) port openFirewall;
enable = true;
secretsFile = dbPassword;
mediaLocation = "${cfg.dataDir}/photos";
environment = {
IMMICH_HOST = lib.mkForce cfg.listenAddress;
IMMICH_TRUSTED_PROXIES = net.hosts.nas.lan;
TZ = "America/Chicago";
};
machine-learning = {
enable = true;
};
};
};
};
in
{
imports = [ immichConfig ];
}