diff --git a/modules/immich.nix b/modules/immich.nix new file mode 100644 index 0000000..e7baffc --- /dev/null +++ b/modules/immich.nix @@ -0,0 +1,35 @@ +{ config +, ... +}: +let + domain = "immich.xnee.net"; +in +{ + security.acme.certs."${domain}" = { }; + networking.domains.subDomains.${domain} = { }; + + services.nginx.virtualHosts."${domain}" = { + useACMEHost = domain; + kTLS = true; + forceSSL = true; + locations."/" = { + proxyPass = "http://${config.services.immich.host}:${builtins.toString config.services.immich.port}"; + }; + }; + + services.immich = { + enable = true; + mediaLocation = "/var/lib/immich"; + host = "::1"; + port = 2283; + redis.enable = true; + database = { + enable = true; + createDB = true; + }; + settings.server.externalDomain = "https://${domain}"; + machine-learning.enable = true; + }; + + backup.paths = [ config.services.immich.mediaLocation ]; +} diff --git a/nodes/heptifili/disko.nix b/nodes/heptifili/disko.nix index 6060aca..05dcdf4 100644 --- a/nodes/heptifili/disko.nix +++ b/nodes/heptifili/disko.nix @@ -68,6 +68,24 @@ }; }; }; + immich = { + device = "/dev/vdd"; + type = "disk"; + content = { + type = "gpt"; + partitions = { + data = { + label = "IMMICH"; + size = "100%"; + content = { + type = "filesystem"; + format = "ext4"; + mountpoint = config.services.immich.mediaLocation; + }; + }; + }; + }; + }; }; }; }