secrets: don't stop services when the secrets target stops
With krops or nixops the secrets target is always restarted during the deployment process. This previously caused unnecessary restarts of all nix-bitcoin services.
This commit is contained in:
parent
b701cb5603
commit
b0c223e716
2 changed files with 15 additions and 3 deletions
|
|
@ -60,8 +60,15 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
systemd.targets.nix-bitcoin-secrets = {};
|
||||
config = {
|
||||
# This target is active when secrets have been setup successfully.
|
||||
systemd.targets.nix-bitcoin-secrets = {
|
||||
# This ensures that the secrets target is always activated when switching
|
||||
# configurations.
|
||||
# In this way `switch-to-configuration` is guaranteed to show an error
|
||||
# when activating the secrets target fails on deployment.
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
};
|
||||
|
||||
nix-bitcoin.setupSecrets = mkIf cfg.generateSecrets true;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue