1
0
Fork 0
mirror of https://github.com/Mic92/sops-nix.git synced 2024-12-14 11:57:52 +00:00

Allow sops-nix to be restarted when systemd is degraded

If Systemd is running, but with even a single failed unit, it'll enter Degraded state.  Restart sops-nix anyway.
This commit is contained in:
A. Manzer 2024-09-26 22:46:07 -04:00 committed by Jörg Thalheim
parent e2d404a7ea
commit 5876a12ff6

View file

@ -278,7 +278,7 @@ in {
linux = let systemctl = config.systemd.user.systemctlPath; in ''
systemdStatus=$(${systemctl} --user is-system-running 2>&1 || true)
if [[ $systemdStatus == 'running' ]]; then
if [[ $systemdStatus == 'running' || $systemdStatus == 'degraded' ]]; then
${systemctl} restart --user sops-nix
else
echo "User systemd daemon not running. Probably executed on boot where no manual start/reload is needed."