From 1841a32db8508a3325a021eebed4b2c6838082e6 Mon Sep 17 00:00:00 2001 From: Pablo Andres Dealbera Date: Mon, 29 Jan 2024 13:26:35 -0300 Subject: nixos/photoprism: use nsenter to call photoprism bin with correct UID and PID (cherry picked from commit bb40443e7790d568058be9b8cd4a8e667b520f34) --- nixos/modules/services/web-apps/photoprism.nix | 3 +++ 1 file changed, 3 insertions(+) (limited to 'nixos') 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 -- cgit 1.4.1