diff --git a/lib/modules/custom-build-vm.nix b/lib/modules/custom-build-vm.nix index 00936a2..12f2e16 100644 --- a/lib/modules/custom-build-vm.nix +++ b/lib/modules/custom-build-vm.nix @@ -124,7 +124,31 @@ in { ; in { 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 =