Skip to content

Commit

Permalink
nixos/test-instrumentation.nix: Fix evaluation error
Browse files Browse the repository at this point in the history
Discovered via NixOS#82743 which
improved option checking, causing an evaluation error that was
hard to understand without running the evaluation manually.
  • Loading branch information
roberth committed Aug 16, 2020
1 parent 6d0a85f commit 2578557
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion nixos/modules/testing/test-instrumentation.nix
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,12 @@ with import ../../lib/qemu-flags.nix { inherit pkgs; };
systemd.services."serial-getty@hvc0".enable = false;

# Only use a serial console, no TTY.
virtualisation.qemu.consoles = [ qemuSerialDevice ];
# NOTE: optionalAttrs
# test-instrumentation.nix appears to be used without qemu-vm.nix, so
# we avoid defining consoles if not possible.
# TODO: refactor such that test-instrumentation can import qemu-vm
# or declare virtualisation.qemu.console option in a module that's always imported
virtualisation = lib.optionalAttrs (options ? virtualisation.qemu.consoles) { qemu.consoles = [ qemuSerialDevice ]; };

boot.initrd.preDeviceCommands =
''
Expand Down

0 comments on commit 2578557

Please sign in to comment.