diff options
author | Robert Hensing <robert@roberthensing.nl> | 2020-08-16 13:50:51 +0200 |
---|---|---|
committer | Robert Hensing <robert@roberthensing.nl> | 2020-08-16 13:50:53 +0200 |
commit | 257855753073987160c293fdedc9d95a33cbc0e8 (patch) | |
tree | 2b9d8d371e96034d48e90165ac671b64df692c1c /nixos/modules/testing/test-instrumentation.nix | |
parent | 6d0a85fe528e020eb7d8eb78d33ee87055c01c74 (diff) | |
download | nixpkgs-257855753073987160c293fdedc9d95a33cbc0e8.tar nixpkgs-257855753073987160c293fdedc9d95a33cbc0e8.tar.gz nixpkgs-257855753073987160c293fdedc9d95a33cbc0e8.tar.bz2 nixpkgs-257855753073987160c293fdedc9d95a33cbc0e8.tar.lz nixpkgs-257855753073987160c293fdedc9d95a33cbc0e8.tar.xz nixpkgs-257855753073987160c293fdedc9d95a33cbc0e8.tar.zst nixpkgs-257855753073987160c293fdedc9d95a33cbc0e8.zip |
nixos/test-instrumentation.nix: Fix evaluation error
Discovered via https://github.com/NixOS/nixpkgs/pull/82743 which improved option checking, causing an evaluation error that was hard to understand without running the evaluation manually.
Diffstat (limited to 'nixos/modules/testing/test-instrumentation.nix')
-rw-r--r-- | nixos/modules/testing/test-instrumentation.nix | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/nixos/modules/testing/test-instrumentation.nix b/nixos/modules/testing/test-instrumentation.nix index 1baeab53b0c..a6b34e36d20 100644 --- a/nixos/modules/testing/test-instrumentation.nix +++ b/nixos/modules/testing/test-instrumentation.nix @@ -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 = '' |