From 5876a12ff688a72a62b553749146612a1d6c12d1 Mon Sep 17 00:00:00 2001 From: "A. Manzer" <33374297+oberon227@users.noreply.github.com> Date: Thu, 26 Sep 2024 22:46:07 -0400 Subject: [PATCH] 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. --- modules/home-manager/sops.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/home-manager/sops.nix b/modules/home-manager/sops.nix index d62ff58f..3520bb9a 100644 --- a/modules/home-manager/sops.nix +++ b/modules/home-manager/sops.nix @@ -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."