This commit is contained in:
John Lancaster
2026-03-25 18:33:54 -05:00
parent 18b6cc16ad
commit 3da3cc2dc6
3 changed files with 5 additions and 3 deletions
+5 -2
View File
@@ -84,9 +84,12 @@ let
systemctlArgs ? [ ],
}:
let
systemctl = lib.getExe' pkgs.systemd "systemctl";
escapedArgs = lib.escapeShellArgs systemctlArgs;
systemctlCommand = "${systemctl} ${escapedArgs}";
renewReloadScript = lib.concatMapStringsSep "\n" (unit: ''
if ${lib.getExe' pkgs.systemd "systemctl"} ${lib.escapeShellArgs systemctlArgs} --quiet is-active "${unit}"; then
${lib.getExe' pkgs.systemd "systemctl"} ${lib.escapeShellArgs systemctlArgs} try-reload-or-restart "${unit}"
if ${systemctlCommand} --quiet is-active "${unit}"; then
${systemctlCommand} try-reload-or-restart "${unit}"
fi
'') reloadUnits;
renewPostCommands = lib.concatStringsSep "\n" postCommands;