diff --git a/flake.nix b/flake.nix index 46922d5c..160ed35d 100644 --- a/flake.nix +++ b/flake.nix @@ -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;