nixos/photoprism: use nsenter to call photoprism bin with correct UID and PID

This commit is contained in:
Pablo Andres Dealbera 2024-01-29 13:26:35 -03:00
parent 58c2a31a59
commit bb40443e77

View File

@ -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