flake.nix: fix *-vm package

This commit is contained in:
Astro 2022-10-21 23:11:15 +02:00
parent 302a7b227e
commit ed35be3bcf
1 changed files with 22 additions and 23 deletions

View File

@ -463,32 +463,31 @@
# boot any machine in a microvm
"${host}-vm" = (self.nixosConfigurations.${host}
.extendModules {
modules = [
microvm.nixosModules.microvm
{
microvm = {
mem = nixos.lib.mkForce 2048;
hypervisor = nixos.lib.mkForce "qemu";
socket = nixos.lib.mkForce null;
shares = nixos.lib.mkForce [ {
tag = "ro-store";
source = "/nix/store";
mountPoint = "/nix/.ro-store";
} ];
interfaces = nixos.lib.mkForce [ {
type = "user";
id = "eth0";
mac = "02:23:de:ad:be:ef";
} ];
};
boot.isContainer = lib.mkForce false;
users.users.root.password = "";
fileSystems."/".fsType = lib.mkForce "tmpfs";
services.getty.helpLine = ''
modules = [ {
microvm = {
mem = nixos.lib.mkForce 2048;
hypervisor = nixos.lib.mkForce "qemu";
socket = nixos.lib.mkForce null;
shares = nixos.lib.mkForce [ {
tag = "ro-store";
source = "/nix/store";
mountPoint = "/nix/.ro-store";
} ];
interfaces = nixos.lib.mkForce [ {
type = "user";
id = "eth0";
mac = "02:23:de:ad:be:ef";
} ];
};
boot.isContainer = lib.mkForce false;
users.users.root.password = "";
fileSystems."/".fsType = lib.mkForce "tmpfs";
services.getty.helpLine = ''
Log in as "root" with an empty password.
Use "reboot" to shut qemu down.
'';
}
} ] ++ lib.optionals (! config ? microvm) [
microvm.nixosModules.microvm
];
})
.config.microvm.declaredRunner;