diff options
author | Maciej Krüger <mkg20001@gmail.com> | 2021-02-14 13:20:44 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-14 13:20:44 +0100 |
commit | 8429831b674ed8f296291c8d54fe7b80677bdde3 (patch) | |
tree | 7e1800d4a47391f08802657471892bbd9f953afd | |
parent | 971a85d2c11f65a0e87e8232b23cabc4090a7db3 (diff) | |
parent | 59eb6d3ee331146bb955922df4dea1ba67487005 (diff) |
Merge pull request #112746 from mkg20001/qemu-extra-disks
-rw-r--r-- | nixos/modules/virtualisation/qemu-vm.nix | 5 | ||||
-rw-r--r-- | nixos/tests/bees.nix | 2 | ||||
-rw-r--r-- | nixos/tests/fsck.nix | 2 | ||||
-rw-r--r-- | nixos/tests/glusterfs.nix | 4 | ||||
-rw-r--r-- | nixos/tests/hardened.nix | 2 | ||||
-rw-r--r-- | nixos/tests/locate.nix | 2 | ||||
-rw-r--r-- | nixos/tests/misc.nix | 2 | ||||
-rw-r--r-- | nixos/tests/nextcloud/basic.nix | 2 | ||||
-rw-r--r-- | nixos/tests/nfs/kerberos.nix | 2 | ||||
-rw-r--r-- | nixos/tests/nfs/simple.nix | 2 | ||||
-rw-r--r-- | nixos/tests/orangefs.nix | 2 | ||||
-rw-r--r-- | nixos/tests/samba.nix | 2 | ||||
-rw-r--r-- | nixos/tests/snapper.nix | 2 | ||||
-rw-r--r-- | nixos/tests/systemd.nix | 2 | ||||
-rw-r--r-- | nixos/tests/zfs.nix | 2 |
15 files changed, 19 insertions, 16 deletions
diff --git a/nixos/modules/virtualisation/qemu-vm.nix b/nixos/modules/virtualisation/qemu-vm.nix index bf3615f2fe71b..5360cff22f3c6 100644 --- a/nixos/modules/virtualisation/qemu-vm.nix +++ b/nixos/modules/virtualisation/qemu-vm.nix @@ -7,7 +7,7 @@ # the VM in the host. On the other hand, the root filesystem is a # read/writable disk image persistent across VM reboots. -{ config, lib, pkgs, ... }: +{ config, lib, pkgs, options, ... }: with lib; with import ../../lib/qemu-flags.nix { inherit pkgs; }; @@ -266,6 +266,8 @@ in options = { + virtualisation.fileSystems = options.fileSystems; + virtualisation.memorySize = mkOption { default = 384; @@ -659,6 +661,7 @@ in # attribute should be disregarded for the purpose of building a VM # test image (since those filesystems don't exist in the VM). fileSystems = mkVMOverride ( + cfg.fileSystems // { "/".device = cfg.bootDevice; ${if cfg.writableStore then "/nix/.ro-store" else "/nix/store"} = { device = "store"; diff --git a/nixos/tests/bees.nix b/nixos/tests/bees.nix index 6e6a9c3446b06..58a9c29513567 100644 --- a/nixos/tests/bees.nix +++ b/nixos/tests/bees.nix @@ -8,7 +8,7 @@ import ./make-test-python.nix ({ lib, pkgs, ... }: ${pkgs.btrfs-progs}/bin/mkfs.btrfs -f -L aux2 /dev/vdc ''; virtualisation.emptyDiskImages = [ 4096 4096 ]; - fileSystems = lib.mkVMOverride { + virtualisation.fileSystems = { "/aux1" = { # filesystem configured to be deduplicated device = "/dev/disk/by-label/aux1"; fsType = "btrfs"; diff --git a/nixos/tests/fsck.nix b/nixos/tests/fsck.nix index e522419fde2b9..5453f3bc48b59 100644 --- a/nixos/tests/fsck.nix +++ b/nixos/tests/fsck.nix @@ -4,7 +4,7 @@ import ./make-test-python.nix { machine = { lib, ... }: { virtualisation.emptyDiskImages = [ 1 ]; - fileSystems = lib.mkVMOverride { + virtualisation.fileSystems = { "/mnt" = { device = "/dev/vdb"; fsType = "ext4"; diff --git a/nixos/tests/glusterfs.nix b/nixos/tests/glusterfs.nix index cb07bc09511dd..ef09264a02167 100644 --- a/nixos/tests/glusterfs.nix +++ b/nixos/tests/glusterfs.nix @@ -3,7 +3,7 @@ import ./make-test-python.nix ({pkgs, lib, ...}: let client = { pkgs, ... } : { environment.systemPackages = [ pkgs.glusterfs ]; - fileSystems = pkgs.lib.mkVMOverride + virtualisation.fileSystems = { "/gluster" = { device = "server1:/gv0"; fsType = "glusterfs"; @@ -22,7 +22,7 @@ let virtualisation.emptyDiskImages = [ 1024 ]; - fileSystems = pkgs.lib.mkVMOverride + virtualisation.fileSystems = { "/data" = { device = "/dev/disk/by-label/data"; fsType = "ext4"; diff --git a/nixos/tests/hardened.nix b/nixos/tests/hardened.nix index d3f1f3172965a..0c26eaa310d49 100644 --- a/nixos/tests/hardened.nix +++ b/nixos/tests/hardened.nix @@ -18,7 +18,7 @@ import ./make-test-python.nix ({ pkgs, latestKernel ? false, ... } : { boot.initrd.postDeviceCommands = '' ${pkgs.dosfstools}/bin/mkfs.vfat -n EFISYS /dev/vdb ''; - fileSystems = lib.mkVMOverride { + virtualisation.fileSystems = { "/efi" = { device = "/dev/disk/by-label/EFISYS"; fsType = "vfat"; diff --git a/nixos/tests/locate.nix b/nixos/tests/locate.nix index 67ae610fe0127..e8ba41812a8f5 100644 --- a/nixos/tests/locate.nix +++ b/nixos/tests/locate.nix @@ -7,7 +7,7 @@ import ./make-test-python.nix ({ lib, pkgs, ... }: nodes = rec { a = { environment.systemPackages = with pkgs; [ sshfs ]; - fileSystems = lib.mkVMOverride { + virtualisation.fileSystems = { "/ssh" = { device = "alice@b:/"; fsType = "fuse.sshfs"; diff --git a/nixos/tests/misc.nix b/nixos/tests/misc.nix index fda2e60a41b6f..fb19b7060562f 100644 --- a/nixos/tests/misc.nix +++ b/nixos/tests/misc.nix @@ -16,7 +16,7 @@ import ./make-test-python.nix ({ pkgs, ...} : rec { environment.variables.EDITOR = mkOverride 0 "emacs"; documentation.nixos.enable = mkOverride 0 true; systemd.tmpfiles.rules = [ "d /tmp 1777 root root 10d" ]; - fileSystems = mkVMOverride { "/tmp2" = + virtualisation.fileSystems = { "/tmp2" = { fsType = "tmpfs"; options = [ "mode=1777" "noauto" ]; }; diff --git a/nixos/tests/nextcloud/basic.nix b/nixos/tests/nextcloud/basic.nix index 9005044704279..0b8e1937128c9 100644 --- a/nixos/tests/nextcloud/basic.nix +++ b/nixos/tests/nextcloud/basic.nix @@ -15,7 +15,7 @@ in { echo "http://nextcloud/remote.php/webdav/ ${adminuser} ${adminpass}" > /tmp/davfs2-secrets chmod 600 /tmp/davfs2-secrets ''; - fileSystems = pkgs.lib.mkVMOverride { + virtualisation.fileSystems = { "/mnt/dav" = { device = "http://nextcloud/remote.php/webdav/"; fsType = "davfs"; diff --git a/nixos/tests/nfs/kerberos.nix b/nixos/tests/nfs/kerberos.nix index 078f0b7814cea..75d1210496b00 100644 --- a/nixos/tests/nfs/kerberos.nix +++ b/nixos/tests/nfs/kerberos.nix @@ -40,7 +40,7 @@ in networking.domain = "nfs.test"; networking.hostName = "client"; - fileSystems = lib.mkVMOverride + virtualisation.fileSystems = { "/data" = { device = "server.nfs.test:/"; fsType = "nfs"; diff --git a/nixos/tests/nfs/simple.nix b/nixos/tests/nfs/simple.nix index 630c68a5b05d0..6a01089c0828c 100644 --- a/nixos/tests/nfs/simple.nix +++ b/nixos/tests/nfs/simple.nix @@ -4,7 +4,7 @@ let client = { pkgs, ... }: - { fileSystems = pkgs.lib.mkVMOverride + { virtualisation.fileSystems = { "/data" = { # nfs4 exports the export with fsid=0 as a virtual root directory device = if (version == 4) then "server:/" else "server:/data"; diff --git a/nixos/tests/orangefs.nix b/nixos/tests/orangefs.nix index 24b7737058c83..fe9f9cc37ea03 100644 --- a/nixos/tests/orangefs.nix +++ b/nixos/tests/orangefs.nix @@ -9,7 +9,7 @@ let virtualisation.emptyDiskImages = [ 4096 ]; - fileSystems = pkgs.lib.mkVMOverride + virtualisation.fileSystems = { "/data" = { device = "/dev/disk/by-label/data"; fsType = "ext4"; diff --git a/nixos/tests/samba.nix b/nixos/tests/samba.nix index 142269752b34f..d1d50caabfa53 100644 --- a/nixos/tests/samba.nix +++ b/nixos/tests/samba.nix @@ -8,7 +8,7 @@ import ./make-test-python.nix ({ pkgs, ... }: nodes = { client = { pkgs, ... }: - { fileSystems = pkgs.lib.mkVMOverride + { virtualisation.fileSystems = { "/public" = { fsType = "cifs"; device = "//server/public"; diff --git a/nixos/tests/snapper.nix b/nixos/tests/snapper.nix index 018102d7f6409..098d8d9d72f55 100644 --- a/nixos/tests/snapper.nix +++ b/nixos/tests/snapper.nix @@ -9,7 +9,7 @@ import ./make-test-python.nix ({ ... }: virtualisation.emptyDiskImages = [ 4096 ]; - fileSystems = lib.mkVMOverride { + virtualisation.fileSystems = { "/home" = { device = "/dev/disk/by-label/aux"; fsType = "btrfs"; diff --git a/nixos/tests/systemd.nix b/nixos/tests/systemd.nix index f7c13a587c58e..e0685f53a9454 100644 --- a/nixos/tests/systemd.nix +++ b/nixos/tests/systemd.nix @@ -9,7 +9,7 @@ import ./make-test-python.nix ({ pkgs, ... }: { environment.systemPackages = [ pkgs.cryptsetup ]; - fileSystems = lib.mkVMOverride { + virtualisation.fileSystems = { "/test-x-initrd-mount" = { device = "/dev/vdb"; fsType = "ext2"; diff --git a/nixos/tests/zfs.nix b/nixos/tests/zfs.nix index 03aa5e5399c65..ba5eb7cd528eb 100644 --- a/nixos/tests/zfs.nix +++ b/nixos/tests/zfs.nix @@ -29,7 +29,7 @@ let # Setup regular fileSystems machinery to ensure forceImportAll can be # tested via the regular service units. - fileSystems = lib.mkVMOverride { + virtualisation.fileSystems = { "/forcepool" = { device = "forcepool"; fsType = "zfs"; |