diff --git a/nixos/modules/services/web-apps/immich.nix b/nixos/modules/services/web-apps/immich.nix index de41536081ea..2224ca1d8ebb 100644 --- a/nixos/modules/services/web-apps/immich.nix +++ b/nixos/modules/services/web-apps/immich.nix @@ -6,6 +6,7 @@ }: let cfg = config.services.immich; + format = pkgs.formats.json { }; isPostgresUnixSocket = lib.hasPrefix "/" cfg.database.host; isRedisUnixSocket = lib.hasPrefix "/" cfg.redis.host; @@ -110,6 +111,37 @@ in description = "The group immich should run as."; }; + settings = mkOption { + default = null; + description = '' + Configuration for Immich. + See or navigate to + for + options and defaults. + Setting it to `null` allows configuring Immich in the web interface. + ''; + type = types.nullOr ( + types.submodule { + freeformType = format.type; + options = { + newVersionCheck.enabled = mkOption { + type = types.bool; + default = false; + description = '' + Check for new versions. + This feature relies on periodic communication with github.com. + ''; + }; + server.externalDomain = mkOption { + type = types.str; + default = ""; + description = "Domain for publicly shared links, including `http(s)://`."; + }; + }; + } + ); + }; + machine-learning = { enable = mkEnableOption "immich's machine-learning functionality to detect faces and search for objects" @@ -262,6 +294,9 @@ in IMMICH_PORT = toString cfg.port; IMMICH_MEDIA_LOCATION = cfg.mediaLocation; IMMICH_MACHINE_LEARNING_URL = "http://localhost:3003"; + } + // lib.optionalAttrs (cfg.settings != null) { + IMMICH_CONFIG_FILE = "${format.generate "immich.json" cfg.settings}"; }; services.immich.machine-learning.environment = {