diff --git a/nixos/modules/services/web-apps/immich.nix b/nixos/modules/services/web-apps/immich.nix index c5820049c215..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 = { @@ -272,6 +307,11 @@ in IMMICH_PORT = "3003"; }; + systemd.slices.system-immich = { + description = "Immich (self-hosted photo and video backup solution) slice"; + documentation = [ "https://immich.app/docs" ]; + }; + systemd.services.immich-server = { description = "Immich backend server (Self-hosted photo and video backup solution)"; after = [ "network.target" ]; @@ -281,6 +321,7 @@ in serviceConfig = commonServiceConfig // { ExecStart = lib.getExe cfg.package; EnvironmentFile = mkIf (cfg.secretsFile != null) cfg.secretsFile; + Slice = "system-immich.slice"; StateDirectory = "immich"; SyslogIdentifier = "immich"; RuntimeDirectory = "immich"; @@ -300,6 +341,7 @@ in inherit (cfg.machine-learning) environment; serviceConfig = commonServiceConfig // { ExecStart = lib.getExe (cfg.package.machine-learning.override { immich = cfg.package; }); + Slice = "system-immich.slice"; CacheDirectory = "immich"; User = cfg.user; Group = cfg.group; diff --git a/pkgs/by-name/im/immich-machine-learning/package.nix b/pkgs/by-name/im/immich-machine-learning/package.nix index 1ca2fa06ed36..7d29efca5603 100644 --- a/pkgs/by-name/im/immich-machine-learning/package.nix +++ b/pkgs/by-name/im/immich-machine-learning/package.nix @@ -28,11 +28,6 @@ python.pkgs.buildPythonApplication rec { "pydantic-settings" ]; - pythonRemoveDeps = [ - # https://github.com/immich-app/immich/pull/13762 - "setuptools" - ]; - build-system = with python.pkgs; [ poetry-core cython diff --git a/pkgs/by-name/im/immich/sources.json b/pkgs/by-name/im/immich/sources.json index 27044f2a25f4..3c4bdf53f702 100644 --- a/pkgs/by-name/im/immich/sources.json +++ b/pkgs/by-name/im/immich/sources.json @@ -1,22 +1,22 @@ { - "version": "1.119.0", - "hash": "sha256-mflVxz+Pxv7xS4onsjRQ1lMZ43U/rkuqO6vPRon7Gms=", + "version": "1.119.1", + "hash": "sha256-T+bIL2LaVNgFT3xBUxiEzhyDiLpw/WU7mxttuJD39SQ=", "components": { "cli": { - "npmDepsHash": "sha256-QClG/WQK2MbVKuR0Wk9+TdSTAbemtFeg7GkKjvEjC4c=", - "version": "2.2.27" + "npmDepsHash": "sha256-kTBlo6eIPswZC0GQG7IoqQZ5b7wPEXFaD/SuuaEQMEg=", + "version": "2.2.28" }, "server": { - "npmDepsHash": "sha256-9mMnOiKsTTO4PJUKYN668yjIELeFUgdqSx6Gf87UYVU=", - "version": "1.119.0" + "npmDepsHash": "sha256-zgzqh3TyafPKuk5RZ2I/haYFzMVlI4jGnwD5XLqTBdg=", + "version": "1.119.1" }, "web": { - "npmDepsHash": "sha256-ieTGMywR26msYqmQOK/q/l3O6/Vkmu0TLFn956kK/xE=", - "version": "1.119.0" + "npmDepsHash": "sha256-LPtsMzF7yYGrrpDoYoba6OQphKY7AvGbJpPc5pS4eFU=", + "version": "1.119.1" }, "open-api/typescript-sdk": { - "npmDepsHash": "sha256-NLvuHTVWuzv5G0ONu3S3K8AgyliTZowYQN0fzYhWtUQ=", - "version": "1.119.0" + "npmDepsHash": "sha256-dyKmDez8jO6p+cmSa2KMe9zzhXn4on3aFUMdep+gjzU=", + "version": "1.119.1" } } } diff --git a/pkgs/development/python-modules/insightface/default.nix b/pkgs/development/python-modules/insightface/default.nix index 534149a1dd97..41be9460fded 100644 --- a/pkgs/development/python-modules/insightface/default.nix +++ b/pkgs/development/python-modules/insightface/default.nix @@ -7,6 +7,7 @@ fetchPypi, insightface, matplotlib, + mxnet, numpy, onnx, onnxruntime, @@ -45,6 +46,7 @@ buildPythonPackage rec { albumentations easydict matplotlib + mxnet # used in insightface/commands/rec_add_mask_param.py numpy onnx onnxruntime diff --git a/pkgs/development/python-modules/mxnet/default.nix b/pkgs/development/python-modules/mxnet/default.nix index 9ee368551103..3b9f692d7205 100644 --- a/pkgs/development/python-modules/mxnet/default.nix +++ b/pkgs/development/python-modules/mxnet/default.nix @@ -2,6 +2,8 @@ lib, buildPythonPackage, pkgs, + setuptools, + distutils, requests, numpy, graphviz, @@ -12,16 +14,23 @@ buildPythonPackage { inherit (pkgs.mxnet) pname version src; + pyproject = true; - format = "setuptools"; + build-system = [ setuptools ]; buildInputs = [ pkgs.mxnet ]; - propagatedBuildInputs = [ + + dependencies = [ + distutils requests numpy graphviz ]; + pythonRelaxDeps = [ + "graphviz" + ]; + LD_LIBRARY_PATH = lib.makeLibraryPath [ pkgs.mxnet ]; doCheck = !isPy3k; @@ -29,9 +38,7 @@ buildPythonPackage { postPatch = '' # Required to support numpy >=1.24 where np.bool is removed in favor of just bool substituteInPlace python/mxnet/numpy/utils.py \ - --replace "bool = onp.bool" "bool = bool" - substituteInPlace python/setup.py \ - --replace "graphviz<0.9.0," "graphviz" + --replace-fail "bool = onp.bool" "bool = bool" ''; preConfigure = ''