add immich

This commit is contained in:
Noah Masur
2024-12-05 21:58:46 +00:00
parent 00f23f4b9c
commit 1b04f9a883
5 changed files with 49 additions and 0 deletions

View File

@ -15,6 +15,7 @@
./cloudflare.nix
./filebrowser.nix
./identity.nix
./immich.nix
./irc.nix
./gitea-runner.nix
./gitea.nix

View File

@ -0,0 +1,42 @@
{ config, lib, ... }:
{
config = lib.mkIf config.services.immich.enable {
services.immich = {
port = 2283;
group = "shared";
database.enable = true;
redis.enable = true;
machine-learning.enable = true;
machine-learning.environment = { };
mediaLocation = "/data/images";
secretsFile = null;
settings.server.externalDomain = "https://${config.hostnames.photos}";
environment = {
IMMICH_ENV = "production";
IMMICH_LOG_LEVEL = "log";
NO_COLOR = "false";
IMMICH_TRUSTED_PROXIES = "127.0.0.1";
};
};
caddy.routes = [
{
match = [ { host = [ config.hostnames.photos ]; } ];
handle = [
{
handler = "reverse_proxy";
upstreams = [ { dial = "localhost:${builtins.toString config.services.immich.port}"; } ];
}
];
}
];
# Configure Cloudflare DNS to point to this machine
services.cloudflare-dyndns.domains = [ config.hostnames.photos ];
};
}