diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2013-10-29 13:04:52 +0100 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2013-10-29 13:14:30 +0100 |
commit | adc1b38b85857630be32452a2cfd26f39946d497 (patch) | |
tree | 121f78854e3f9a8e2bc85065867c8b04e511ea03 /nixos | |
parent | f0b7b0af12be7b36add358cd1e24bbca02e57c64 (diff) | |
download | nixlib-adc1b38b85857630be32452a2cfd26f39946d497.tar nixlib-adc1b38b85857630be32452a2cfd26f39946d497.tar.gz nixlib-adc1b38b85857630be32452a2cfd26f39946d497.tar.bz2 nixlib-adc1b38b85857630be32452a2cfd26f39946d497.tar.lz nixlib-adc1b38b85857630be32452a2cfd26f39946d497.tar.xz nixlib-adc1b38b85857630be32452a2cfd26f39946d497.tar.zst nixlib-adc1b38b85857630be32452a2cfd26f39946d497.zip |
Add a priority level for overrides in VM tests
Now that overriding fileSystems in qemu-vm.nix works again, it's important that the VM tests that add additional file systems use the same override priority. Instead of using the same magic constant everywhere, they can now use mkVMOverride. http://hydra.nixos.org/build/6695561
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/modules/virtualisation/qemu-vm.nix | 28 | ||||
-rw-r--r-- | nixos/tests/check-filesystems.nix | 2 | ||||
-rw-r--r-- | nixos/tests/nfs.nix | 2 | ||||
-rw-r--r-- | nixos/tests/trac.nix | 2 |
4 files changed, 17 insertions, 17 deletions
diff --git a/nixos/modules/virtualisation/qemu-vm.nix b/nixos/modules/virtualisation/qemu-vm.nix index 6648b6514d01..23b488f92785 100644 --- a/nixos/modules/virtualisation/qemu-vm.nix +++ b/nixos/modules/virtualisation/qemu-vm.nix @@ -273,7 +273,7 @@ in config = { - boot.loader.grub.device = mkOverride 50 "/dev/vda"; + boot.loader.grub.device = mkVMOverride "/dev/vda"; boot.initrd.supportedFilesystems = optional cfg.writableStore "unionfs-fuse"; @@ -337,13 +337,13 @@ in virtualisation.qemu.options = [ "-vga std" "-usbdevice tablet" ]; - # Mount the host filesystem via 9P, and bind-mount the Nix store of - # the host into our own filesystem. We use mkOverride to allow this - # module to be applied to "normal" NixOS system configuration, where - # the regular value for the `fileSystems' attribute should be - # disregarded for the purpose of building a VM test image (since - # those filesystems don't exist in the VM). - fileSystems = mkOverride 10 + # Mount the host filesystem via 9P, and bind-mount the Nix store + # of the host into our own filesystem. We use mkVMOverride to + # allow this module to be applied to "normal" NixOS system + # configuration, where the regular value for the `fileSystems' + # attribute should be disregarded for the purpose of building a VM + # test image (since those filesystems don't exist in the VM). + fileSystems = mkVMOverride { "/".device = "/dev/vda"; "/nix/store" = { device = "store"; @@ -371,7 +371,7 @@ in }; }; - swapDevices = mkOverride 50 [ ]; + swapDevices = mkVMOverride [ ]; # Don't run ntpd in the guest. It should get the correct time from KVM. services.ntp.enable = false; @@ -385,10 +385,10 @@ in # When building a regular system configuration, override whatever # video driver the host uses. - services.xserver.videoDriver = mkOverride 50 null; - services.xserver.videoDrivers = mkOverride 50 [ "vesa" ]; - services.xserver.defaultDepth = mkOverride 50 0; - services.xserver.resolutions = mkOverride 50 [ { x = 1024; y = 768; } ]; + services.xserver.videoDriver = mkVMOverride null; + services.xserver.videoDrivers = mkVMOverride [ "vesa" ]; + services.xserver.defaultDepth = mkVMOverride 0; + services.xserver.resolutions = mkVMOverride [ { x = 1024; y = 768; } ]; services.xserver.monitorSection = '' # Set a higher refresh rate so that resolutions > 800x600 work. @@ -397,7 +397,7 @@ in ''; # Wireless won't work in the VM. - networking.wireless.enable = mkOverride 50 false; + networking.wireless.enable = mkVMOverride false; system.requiredKernelConfig = with config.lib.kernelConfig; [ (isEnabled "VIRTIO_BLK") diff --git a/nixos/tests/check-filesystems.nix b/nixos/tests/check-filesystems.nix index c1dae0ca621a..09401f9a3f44 100644 --- a/nixos/tests/check-filesystems.nix +++ b/nixos/tests/check-filesystems.nix @@ -40,7 +40,7 @@ rec { device = "share:/repos2"; fsType = "nfs"; }; - in pkgs.lib.mkOverride 50 [ + in pkgs.lib.mkVMOverride [ repos1 repos1 # check remount repos2 # check after remount diff --git a/nixos/tests/nfs.nix b/nixos/tests/nfs.nix index ee65c298dd00..51abf57e1b75 100644 --- a/nixos/tests/nfs.nix +++ b/nixos/tests/nfs.nix @@ -6,7 +6,7 @@ let client = { config, pkgs, ... }: - { fileSystems = pkgs.lib.mkOverride 50 + { fileSystems = pkgs.lib.mkVMOverride [ { mountPoint = "/data"; device = "server:${if version == 4 then "/" else "/data"}"; fsType = "nfs"; diff --git a/nixos/tests/trac.nix b/nixos/tests/trac.nix index 72442c885ace..e0d256f57019 100644 --- a/nixos/tests/trac.nix +++ b/nixos/tests/trac.nix @@ -27,7 +27,7 @@ webserver = { config, pkgs, ... }: - { fileSystems = pkgs.lib.mkOverride 50 + { fileSystems = pkgs.lib.mkVMOverride [ { mountPoint = "/repos"; device = "storage:/repos"; fsType = "nfs"; |