mirror of
https://github.com/Mic92/sops-nix.git
synced 2026-07-17 14:35:25 +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}" ];
|
ExecStart = [ "${cfg.package}/bin/sops-install-secrets ${manifest}" ];
|
||||||
RemainAfterExit = true;
|
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 = {
|
system.activationScripts = {
|
||||||
|
|
|
||||||
|
|
@ -44,6 +44,12 @@ in
|
||||||
ExecStart = [ "${cfg.package}/bin/sops-install-secrets -ignore-passwd ${manifestForUsers}" ];
|
ExecStart = [ "${cfg.package}/bin/sops-install-secrets -ignore-passwd ${manifestForUsers}" ];
|
||||||
RemainAfterExit = true;
|
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) {
|
system.activationScripts = lib.mkIf (secretsForUsers != { } && !useSystemdActivation) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue