mirror of
https://github.com/Mic92/sops-nix.git
synced 2026-05-10 17:45:56 +08:00
fix(systemd): require mounts for encryption keys.
This helps address issues in https://github.com/nix-community/impermanence/issues/294 and in general also works for https://github.com/nix-community/preservation type of workflows which also rely on systemd mounts.
This commit is contained in:
parent
bc02e2e5f6
commit
fbedbb8cb1
2 changed files with 12 additions and 0 deletions
|
|
@ -484,6 +484,12 @@ in
|
|||
ExecStart = [ "${cfg.package}/bin/sops-install-secrets ${manifest}" ];
|
||||
RemainAfterExit = true;
|
||||
};
|
||||
unitConfig.RequiresMountsFor = lib.concatLists [
|
||||
(lib.lists.optional (cfg.gnupg.home != null) cfg.gnupg.home)
|
||||
cfg.gnupg.sshKeyPaths
|
||||
(lib.lists.optional (cfg.age.keyFile != null) cfg.age.keyFile)
|
||||
cfg.age.sshKeyPaths
|
||||
];
|
||||
};
|
||||
|
||||
system.activationScripts = {
|
||||
|
|
|
|||
|
|
@ -44,6 +44,12 @@ in
|
|||
ExecStart = [ "${cfg.package}/bin/sops-install-secrets -ignore-passwd ${manifestForUsers}" ];
|
||||
RemainAfterExit = true;
|
||||
};
|
||||
unitConfig.RequiresMountsFor = lib.concatLists [
|
||||
(lib.lists.optional (cfg.gnupg.home != null) cfg.gnupg.home)
|
||||
cfg.gnupg.sshKeyPaths
|
||||
(lib.lists.optional (cfg.age.keyFile != null) cfg.age.keyFile)
|
||||
cfg.age.sshKeyPaths
|
||||
];
|
||||
};
|
||||
|
||||
system.activationScripts = lib.mkIf (secretsForUsers != { } && !useSystemdActivation) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue