diff --git a/nixos/modules/services/web-apps/photoprism.nix b/nixos/modules/services/web-apps/photoprism.nix index f4b91288b1d2..fc61ba7b0439 100644 --- a/nixos/modules/services/web-apps/photoprism.nix +++ b/nixos/modules/services/web-apps/photoprism.nix @@ -89,6 +89,18 @@ in ''; }; + user = lib.mkOption { + type = lib.types.str; + default = "photoprism"; + description = "User under which photoprism runs."; + }; + + group = lib.mkOption { + type = lib.types.str; + default = "photoprism"; + description = "Group under which photoprism runs."; + }; + package = lib.mkPackageOption pkgs "photoprism" { }; settings = lib.mkOption { @@ -110,11 +122,11 @@ in serviceConfig = { Restart = "on-failure"; - User = "photoprism"; - Group = "photoprism"; + User = cfg.user; + Group = cfg.group; DynamicUser = true; StateDirectory = "photoprism"; - WorkingDirectory = "/var/lib/photoprism"; + WorkingDirectory = cfg.storagePath; RuntimeDirectory = "photoprism"; ReadWritePaths = [ cfg.originalsPath