Set default password for build-vm-with-bootloader

This commit is contained in:
Manuel Thalmann 2024-05-02 04:50:36 +02:00
parent 5ed881f694
commit 354982cf37

View file

@ -124,7 +124,31 @@ in {
; ;
in { in {
vmVariant = extendVMConfig vmVariant; vmVariant = extendVMConfig vmVariant;
vmVariantWithBootLoader = extendVMConfig vmVariantWithBootLoader; vmVariantWithBootLoader =
(extendVMConfig vmVariantWithBootLoader) //
# Overwrite users with `hashedPasswordFile`s as `sops-nix` does not seem to work with `build-vm-with-bootloader`
{
users.users = builtins.listToAttrs (
builtins.map (
name: {
inherit name;
value = {
hashedPasswordFile = lib.mkVMOverride null;
password = lib.mkVMOverride "test";
};
})
(builtins.filter
(
name:
let
user = config.users.users.${name};
in
(
(user.hashedPasswordFile != null)
))
(builtins.attrNames config.users.users)));
};
}; };
system.build = system.build =