nixos/tandoor-recipes: fix database management script

UID is a read-only shell variable. Lowercase shell variables are used to avoid this conflict.
This commit is contained in:
Trent Baldwin
2025-07-13 15:29:37 -04:00
parent 028893d7f4
commit a6071697b7

View File

@@ -24,9 +24,10 @@ let
manage = pkgs.writeShellScript "manage" ''
set -o allexport # Export the following env vars
${lib.toShellVars env}
eval "$(${config.systemd.package}/bin/systemctl show -pUID,GID,MainPID tandoor-recipes.service)"
# UID is a read-only shell variable
eval "$(${config.systemd.package}/bin/systemctl show -pUID,GID,MainPID tandoor-recipes.service | tr '[:upper:]' '[:lower:]')"
exec ${pkgs.util-linux}/bin/nsenter \
-t $MainPID -m -S $UID -G $GID --wdns=${env.MEDIA_ROOT} \
-t $mainpid -m -S $uid -G $gid --wdns=${env.MEDIA_ROOT} \
${pkg}/bin/tandoor-recipes "$@"
'';
in