Skip to content

Commit

Permalink
Allow sops-nix to be restarted when systemd is degraded
Browse files Browse the repository at this point in the history
If Systemd is running, but with even a single failed unit, it'll enter Degraded state.  Restart sops-nix anyway.
  • Loading branch information
oberon227 authored and Mic92 committed Sep 27, 2024
1 parent e2d404a commit 5876a12
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/home-manager/sops.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down

0 comments on commit 5876a12

Please sign in to comment.