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 = {
|
config = {
|
||||||
|
virtualisation =
|
||||||
|
let
|
||||||
|
extendVMConfig =
|
||||||
|
vmVariant: {
|
||||||
users.users =
|
users.users =
|
||||||
with { inherit (config.virtualisation.vmVariantWithBootLoader.users) sopsPasswordOverride; };
|
with { inherit (vmVariant.users) sopsPasswordOverride; };
|
||||||
(lib.mkIf
|
(lib.mkIf
|
||||||
sopsPasswordOverride.enable
|
sopsPasswordOverride.enable
|
||||||
(
|
(
|
||||||
|
@ -54,4 +58,14 @@
|
||||||
))
|
))
|
||||||
(builtins.attrNames config.users.users)))));
|
(builtins.attrNames config.users.users)))));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
inherit (config.virtualisation)
|
||||||
|
vmVariant
|
||||||
|
vmVariantWithBootLoader
|
||||||
|
;
|
||||||
|
in {
|
||||||
|
vmVariant = extendVMConfig vmVariant;
|
||||||
|
vmVariantWithBootLoader = extendVMConfig vmVariantWithBootLoader;
|
||||||
|
};
|
||||||
|
};
|
||||||
}
|
}
|
Loading…
Reference in a new issue