Allow sops-nix to be restarted when systemd is degraded #626
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When even a single unit is failed,
systemd is-system-running
will returndegraded
. This will prevent sops-nix from being restarted, and will make is seem like sops-nixs under home-manager isn't working.According to https://www.freedesktop.org/software/systemd/man/latest/systemctl.html#is-system-running,
degraded
means systemd is in a running state (not starting, or stopping), but that there's one or more failed units.Inspired by https://github.com/nix-community/home-manager/blob/ffe2d07e771580a005e675108212597e5b367d2d/modules/systemd.nix#L358 I've added
degraded
as a state in which the activation script will restartsops-nix
.This will help sops-nix under home-manager behave better when there are other, unrelated unit failures on the system.