Refactor sops-nix override configuration
This commit is contained in:
parent
1a57b9d49b
commit
83bfad9a1b
1 changed files with 40 additions and 26 deletions
|
@ -26,8 +26,12 @@
|
|||
};
|
||||
|
||||
config = {
|
||||
virtualisation =
|
||||
let
|
||||
extendVMConfig =
|
||||
vmVariant: {
|
||||
users.users =
|
||||
with { inherit (config.virtualisation.vmVariantWithBootLoader.users) sopsPasswordOverride; };
|
||||
with { inherit (vmVariant.users) sopsPasswordOverride; };
|
||||
(lib.mkIf
|
||||
sopsPasswordOverride.enable
|
||||
(
|
||||
|
@ -54,4 +58,14 @@
|
|||
))
|
||||
(builtins.attrNames config.users.users)))));
|
||||
};
|
||||
|
||||
inherit (config.virtualisation)
|
||||
vmVariant
|
||||
vmVariantWithBootLoader
|
||||
;
|
||||
in {
|
||||
vmVariant = extendVMConfig vmVariant;
|
||||
vmVariantWithBootLoader = extendVMConfig vmVariantWithBootLoader;
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue