git.iko.soy/typeable/nixpkgs
on master help sign in
nixos/nixos-build-vms: use `pkgs.qemu` for virtualisation

When I test a change e.g. in the module system manually, I usually use `nixos-build-vms(8)` which also gives me a QEMU window where I can play around in the freshly built VM. It seems as this has changed recently when the default package for non-interactive VM tests using the same framework was switched to `pkgs.qemu_test` to reduce the closure size. While this is a reasonable decision for our CI tests, I think that you really want a QEMU window of the VM by default when using `nixos-build-vms(8)`. [1] bc2188b083dfbbe749a221023e2960b60d4c8951

commitaab534b894c60e69199aba4cc57b8b3f8fd1a8c2 authorMaximilian Bosch <maximilian@mbosch.me> dateFri 23 Oct 2020, 17:33 (6 years ago) parent972ba80
2 files changed+7−2
nixos/modules/installer/tools/nixos-build-vms/build-vms.nix+6−1 nixos/modules/testing/test-instrumentation.nix+1−1
nixos/modules/installer/tools/nixos-build-vms/build-vms.nix+6−1
@@ -6,7 +6,12 @@
66let
77 nodes = builtins.mapAttrs (vm: module: {
88 _file = "${networkExpr}@node-${vm}";
9− imports = [ module ];
9+ imports = [
10+ module
11+ ({ pkgs, ... }: {
12+ virtualisation.qemu.package = pkgs.qemu;
13+ })
14+ ];
1015 }) (import networkExpr);
1116in
1217
nixos/modules/testing/test-instrumentation.nix+1−1
@@ -53,7 +53,7 @@ with import ../../lib/qemu-flags.nix { inherit pkgs; };
5353 # or declare virtualisation.qemu.console option in a module that's always imported
5454 virtualisation.qemu = {
5555 consoles = lib.optional (options ? virtualisation.qemu.consoles) qemuSerialDevice;
56− package = pkgs.qemu_test;
56+ package = lib.mkDefault pkgs.qemu_test;
5757 };
5858
5959 boot.initrd.preDeviceCommands =