diff options
author | Pablo Andres Dealbera <dealberapablo07@gmail.com> | 2024-01-29 13:26:35 -0300 |
---|---|---|
committer | github-actions[bot] <github-actions[bot]@users.noreply.github.com> | 2024-01-31 19:52:41 +0000 |
commit | 1841a32db8508a3325a021eebed4b2c6838082e6 (patch) | |
tree | aac872a11574b163ef37700454b8bedd887959d0 | |
parent | c9c08df33312756fb3acc118163438ddaf95eed1 (diff) |
nixos/photoprism: use nsenter to call photoprism bin with correct UID and PID
(cherry picked from commit bb40443e7790d568058be9b8cd4a8e667b520f34)
-rw-r--r-- | nixos/modules/services/web-apps/photoprism.nix | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/nixos/modules/services/web-apps/photoprism.nix b/nixos/modules/services/web-apps/photoprism.nix index 423ad5375baab..1a0ce6c078da1 100644 --- a/nixos/modules/services/web-apps/photoprism.nix +++ b/nixos/modules/services/web-apps/photoprism.nix @@ -18,6 +18,9 @@ let in pkgs.writeShellScript "manage" '' ${setupEnv} + eval "$(${config.systemd.package}/bin/systemctl show -pUID,MainPID photoprism.service | ${pkgs.gnused}/bin/sed "s/UID/ServiceUID/")" + exec ${pkgs.util-linux}/bin/nsenter \ + -t $MainPID -m -S $ServiceUID -G $ServiceUID --wdns=${cfg.storagePath} \ exec ${cfg.package}/bin/photoprism "$@" ''; in |