41 lines
823 B
Nix
41 lines
823 B
Nix
{
|
|
service_configs,
|
|
pkgs,
|
|
config,
|
|
username,
|
|
...
|
|
}:
|
|
{
|
|
services.immich = {
|
|
enable = true;
|
|
mediaLocation = service_configs.immich.dir;
|
|
port = 2284;
|
|
# openFirewall = true;
|
|
host = "0.0.0.0";
|
|
database = {
|
|
createDB = false;
|
|
};
|
|
};
|
|
|
|
services.caddy.virtualHosts."immich.${service_configs.https.domain}".extraConfig = ''
|
|
reverse_proxy :${builtins.toString config.services.immich.port}
|
|
'';
|
|
|
|
systemd.tmpfiles.rules = [
|
|
"d ${config.services.immich.mediaLocation} 0770 ${config.services.immich.user} ${config.services.immich.group}"
|
|
];
|
|
|
|
environment.systemPackages = with pkgs; [
|
|
immich-go
|
|
];
|
|
|
|
users.users.${config.services.immich.user}.extraGroups = [
|
|
"video"
|
|
"render"
|
|
];
|
|
|
|
users.users.${username}.extraGroups = [
|
|
config.services.immich.group
|
|
];
|
|
}
|