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