Skip to content

Commit a2bcd1c

Browse files
committed
Revert "modules/sops: allow forcing systemd-based activation"
This reverts commit b80c966. See #856
1 parent b80c966 commit a2bcd1c

File tree

1 file changed

+6
-15
lines changed

1 file changed

+6
-15
lines changed

modules/sops/default.nix

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ let
2929
# Currently, all templates are "regular" (there's no support for `neededForUsers` for templates.)
3030
regularTemplates = cfg.templates;
3131

32+
useSystemdActivation =
33+
(options.systemd ? sysusers && config.systemd.sysusers.enable)
34+
|| (options.services ? userborn && config.services.userborn.enable);
35+
3236
withEnvironment = import ./with-environment.nix {
3337
# sops >=3.10.0 now unconditionally searches
3438
# for an SSH key in $HOME/.ssh/, introduced in #1692 [0]. Since in the
@@ -315,19 +319,6 @@ in
315319
'';
316320
};
317321

318-
useSystemdActivation = lib.mkOption {
319-
type = lib.types.bool;
320-
default =
321-
(options.systemd ? sysusers && config.systemd.sysusers.enable)
322-
|| (options.services ? userborn && config.services.userborn.enable);
323-
description = ''
324-
Use a systemd unit to install secrets, instead of deploying them using an activation script.
325-
326-
This option is automatically enabled when systemd-sysusers or userborn are used to manage users and groups.
327-
It can also be useful to specify additional dependencies to be satisfied before secrets are installed, such as required mountpoints for SOPS key files.
328-
'';
329-
};
330-
331322
age = {
332323
keyFile = lib.mkOption {
333324
type = lib.types.nullOr pathNotInStore;
@@ -442,7 +433,7 @@ in
442433
);
443434

444435
# When using sysusers we no longer are started as an activation script because those are started in initrd while sysusers is started later.
445-
systemd.services.sops-install-secrets = lib.mkIf (regularSecrets != { } && cfg.useSystemdActivation) {
436+
systemd.services.sops-install-secrets = lib.mkIf (regularSecrets != { } && useSystemdActivation) {
446437
wantedBy = [ "sysinit.target" ];
447438
after = [ "systemd-sysusers.service" ];
448439
environment = cfg.environment;
@@ -456,7 +447,7 @@ in
456447
};
457448

458449
system.activationScripts = {
459-
setupSecrets = lib.mkIf (regularSecrets != { } && !cfg.useSystemdActivation) (
450+
setupSecrets = lib.mkIf (regularSecrets != { } && !useSystemdActivation) (
460451
lib.stringAfter
461452
(
462453
[

0 commit comments

Comments
 (0)