diff options
author | Felix Buehler <account@buehler.rocks> | 2024-02-13 18:51:30 +0100 |
---|---|---|
committer | Felix Buehler <account@buehler.rocks> | 2024-02-13 18:51:30 +0100 |
commit | 9db5906a6f1cde4dc2cf271031d765dbb6598f80 (patch) | |
tree | e4e6bd5714b731b1e1a4d7bb505d96dd3507c73b /nixos/modules/services/web-apps/photoprism.nix | |
parent | dd7b7a8f7b2943862403e40972e67823058f3525 (diff) |
nixos/photoprism: improve manage script
Diffstat (limited to 'nixos/modules/services/web-apps/photoprism.nix')
-rw-r--r-- | nixos/modules/services/web-apps/photoprism.nix | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/nixos/modules/services/web-apps/photoprism.nix b/nixos/modules/services/web-apps/photoprism.nix index d3773cc9cf788..ccf995fccf3e5 100644 --- a/nixos/modules/services/web-apps/photoprism.nix +++ b/nixos/modules/services/web-apps/photoprism.nix @@ -12,17 +12,14 @@ let lib.mapAttrs (_: toString) cfg.settings ); - manage = - let - setupEnv = lib.concatStringsSep "\n" (lib.mapAttrsToList (name: val: "export ${name}=${lib.escapeShellArg val}") env); - 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} \ - ${cfg.package}/bin/photoprism "$@" - ''; + manage = pkgs.writeShellScript "manage" '' + set -o allexport # Export the following env vars + ${lib.toShellVars env} + 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} \ + ${cfg.package}/bin/photoprism "$@" + ''; in { meta.maintainers = with lib.maintainers; [ stunkymonkey ]; |