Merge pull request #112746 from mkg20001/qemu-extra-disks
This commit is contained in:
commit
8429831b67
@ -7,7 +7,7 @@
|
|||||||
# the VM in the host. On the other hand, the root filesystem is a
|
# the VM in the host. On the other hand, the root filesystem is a
|
||||||
# read/writable disk image persistent across VM reboots.
|
# read/writable disk image persistent across VM reboots.
|
||||||
|
|
||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, pkgs, options, ... }:
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
with import ../../lib/qemu-flags.nix { inherit pkgs; };
|
with import ../../lib/qemu-flags.nix { inherit pkgs; };
|
||||||
@ -266,6 +266,8 @@ in
|
|||||||
|
|
||||||
options = {
|
options = {
|
||||||
|
|
||||||
|
virtualisation.fileSystems = options.fileSystems;
|
||||||
|
|
||||||
virtualisation.memorySize =
|
virtualisation.memorySize =
|
||||||
mkOption {
|
mkOption {
|
||||||
default = 384;
|
default = 384;
|
||||||
@ -659,6 +661,7 @@ in
|
|||||||
# attribute should be disregarded for the purpose of building a VM
|
# attribute should be disregarded for the purpose of building a VM
|
||||||
# test image (since those filesystems don't exist in the VM).
|
# test image (since those filesystems don't exist in the VM).
|
||||||
fileSystems = mkVMOverride (
|
fileSystems = mkVMOverride (
|
||||||
|
cfg.fileSystems //
|
||||||
{ "/".device = cfg.bootDevice;
|
{ "/".device = cfg.bootDevice;
|
||||||
${if cfg.writableStore then "/nix/.ro-store" else "/nix/store"} =
|
${if cfg.writableStore then "/nix/.ro-store" else "/nix/store"} =
|
||||||
{ device = "store";
|
{ device = "store";
|
||||||
|
@ -8,7 +8,7 @@ import ./make-test-python.nix ({ lib, pkgs, ... }:
|
|||||||
${pkgs.btrfs-progs}/bin/mkfs.btrfs -f -L aux2 /dev/vdc
|
${pkgs.btrfs-progs}/bin/mkfs.btrfs -f -L aux2 /dev/vdc
|
||||||
'';
|
'';
|
||||||
virtualisation.emptyDiskImages = [ 4096 4096 ];
|
virtualisation.emptyDiskImages = [ 4096 4096 ];
|
||||||
fileSystems = lib.mkVMOverride {
|
virtualisation.fileSystems = {
|
||||||
"/aux1" = { # filesystem configured to be deduplicated
|
"/aux1" = { # filesystem configured to be deduplicated
|
||||||
device = "/dev/disk/by-label/aux1";
|
device = "/dev/disk/by-label/aux1";
|
||||||
fsType = "btrfs";
|
fsType = "btrfs";
|
||||||
|
@ -4,7 +4,7 @@ import ./make-test-python.nix {
|
|||||||
machine = { lib, ... }: {
|
machine = { lib, ... }: {
|
||||||
virtualisation.emptyDiskImages = [ 1 ];
|
virtualisation.emptyDiskImages = [ 1 ];
|
||||||
|
|
||||||
fileSystems = lib.mkVMOverride {
|
virtualisation.fileSystems = {
|
||||||
"/mnt" = {
|
"/mnt" = {
|
||||||
device = "/dev/vdb";
|
device = "/dev/vdb";
|
||||||
fsType = "ext4";
|
fsType = "ext4";
|
||||||
|
@ -3,7 +3,7 @@ import ./make-test-python.nix ({pkgs, lib, ...}:
|
|||||||
let
|
let
|
||||||
client = { pkgs, ... } : {
|
client = { pkgs, ... } : {
|
||||||
environment.systemPackages = [ pkgs.glusterfs ];
|
environment.systemPackages = [ pkgs.glusterfs ];
|
||||||
fileSystems = pkgs.lib.mkVMOverride
|
virtualisation.fileSystems =
|
||||||
{ "/gluster" =
|
{ "/gluster" =
|
||||||
{ device = "server1:/gv0";
|
{ device = "server1:/gv0";
|
||||||
fsType = "glusterfs";
|
fsType = "glusterfs";
|
||||||
@ -22,7 +22,7 @@ let
|
|||||||
|
|
||||||
virtualisation.emptyDiskImages = [ 1024 ];
|
virtualisation.emptyDiskImages = [ 1024 ];
|
||||||
|
|
||||||
fileSystems = pkgs.lib.mkVMOverride
|
virtualisation.fileSystems =
|
||||||
{ "/data" =
|
{ "/data" =
|
||||||
{ device = "/dev/disk/by-label/data";
|
{ device = "/dev/disk/by-label/data";
|
||||||
fsType = "ext4";
|
fsType = "ext4";
|
||||||
|
@ -18,7 +18,7 @@ import ./make-test-python.nix ({ pkgs, latestKernel ? false, ... } : {
|
|||||||
boot.initrd.postDeviceCommands = ''
|
boot.initrd.postDeviceCommands = ''
|
||||||
${pkgs.dosfstools}/bin/mkfs.vfat -n EFISYS /dev/vdb
|
${pkgs.dosfstools}/bin/mkfs.vfat -n EFISYS /dev/vdb
|
||||||
'';
|
'';
|
||||||
fileSystems = lib.mkVMOverride {
|
virtualisation.fileSystems = {
|
||||||
"/efi" = {
|
"/efi" = {
|
||||||
device = "/dev/disk/by-label/EFISYS";
|
device = "/dev/disk/by-label/EFISYS";
|
||||||
fsType = "vfat";
|
fsType = "vfat";
|
||||||
|
@ -7,7 +7,7 @@ import ./make-test-python.nix ({ lib, pkgs, ... }:
|
|||||||
nodes = rec {
|
nodes = rec {
|
||||||
a = {
|
a = {
|
||||||
environment.systemPackages = with pkgs; [ sshfs ];
|
environment.systemPackages = with pkgs; [ sshfs ];
|
||||||
fileSystems = lib.mkVMOverride {
|
virtualisation.fileSystems = {
|
||||||
"/ssh" = {
|
"/ssh" = {
|
||||||
device = "alice@b:/";
|
device = "alice@b:/";
|
||||||
fsType = "fuse.sshfs";
|
fsType = "fuse.sshfs";
|
||||||
|
@ -16,7 +16,7 @@ import ./make-test-python.nix ({ pkgs, ...} : rec {
|
|||||||
environment.variables.EDITOR = mkOverride 0 "emacs";
|
environment.variables.EDITOR = mkOverride 0 "emacs";
|
||||||
documentation.nixos.enable = mkOverride 0 true;
|
documentation.nixos.enable = mkOverride 0 true;
|
||||||
systemd.tmpfiles.rules = [ "d /tmp 1777 root root 10d" ];
|
systemd.tmpfiles.rules = [ "d /tmp 1777 root root 10d" ];
|
||||||
fileSystems = mkVMOverride { "/tmp2" =
|
virtualisation.fileSystems = { "/tmp2" =
|
||||||
{ fsType = "tmpfs";
|
{ fsType = "tmpfs";
|
||||||
options = [ "mode=1777" "noauto" ];
|
options = [ "mode=1777" "noauto" ];
|
||||||
};
|
};
|
||||||
|
@ -15,7 +15,7 @@ in {
|
|||||||
echo "http://nextcloud/remote.php/webdav/ ${adminuser} ${adminpass}" > /tmp/davfs2-secrets
|
echo "http://nextcloud/remote.php/webdav/ ${adminuser} ${adminpass}" > /tmp/davfs2-secrets
|
||||||
chmod 600 /tmp/davfs2-secrets
|
chmod 600 /tmp/davfs2-secrets
|
||||||
'';
|
'';
|
||||||
fileSystems = pkgs.lib.mkVMOverride {
|
virtualisation.fileSystems = {
|
||||||
"/mnt/dav" = {
|
"/mnt/dav" = {
|
||||||
device = "http://nextcloud/remote.php/webdav/";
|
device = "http://nextcloud/remote.php/webdav/";
|
||||||
fsType = "davfs";
|
fsType = "davfs";
|
||||||
|
@ -40,7 +40,7 @@ in
|
|||||||
networking.domain = "nfs.test";
|
networking.domain = "nfs.test";
|
||||||
networking.hostName = "client";
|
networking.hostName = "client";
|
||||||
|
|
||||||
fileSystems = lib.mkVMOverride
|
virtualisation.fileSystems =
|
||||||
{ "/data" = {
|
{ "/data" = {
|
||||||
device = "server.nfs.test:/";
|
device = "server.nfs.test:/";
|
||||||
fsType = "nfs";
|
fsType = "nfs";
|
||||||
|
@ -4,7 +4,7 @@ let
|
|||||||
|
|
||||||
client =
|
client =
|
||||||
{ pkgs, ... }:
|
{ pkgs, ... }:
|
||||||
{ fileSystems = pkgs.lib.mkVMOverride
|
{ virtualisation.fileSystems =
|
||||||
{ "/data" =
|
{ "/data" =
|
||||||
{ # nfs4 exports the export with fsid=0 as a virtual root directory
|
{ # nfs4 exports the export with fsid=0 as a virtual root directory
|
||||||
device = if (version == 4) then "server:/" else "server:/data";
|
device = if (version == 4) then "server:/" else "server:/data";
|
||||||
|
@ -9,7 +9,7 @@ let
|
|||||||
|
|
||||||
virtualisation.emptyDiskImages = [ 4096 ];
|
virtualisation.emptyDiskImages = [ 4096 ];
|
||||||
|
|
||||||
fileSystems = pkgs.lib.mkVMOverride
|
virtualisation.fileSystems =
|
||||||
{ "/data" =
|
{ "/data" =
|
||||||
{ device = "/dev/disk/by-label/data";
|
{ device = "/dev/disk/by-label/data";
|
||||||
fsType = "ext4";
|
fsType = "ext4";
|
||||||
|
@ -8,7 +8,7 @@ import ./make-test-python.nix ({ pkgs, ... }:
|
|||||||
nodes =
|
nodes =
|
||||||
{ client =
|
{ client =
|
||||||
{ pkgs, ... }:
|
{ pkgs, ... }:
|
||||||
{ fileSystems = pkgs.lib.mkVMOverride
|
{ virtualisation.fileSystems =
|
||||||
{ "/public" = {
|
{ "/public" = {
|
||||||
fsType = "cifs";
|
fsType = "cifs";
|
||||||
device = "//server/public";
|
device = "//server/public";
|
||||||
|
@ -9,7 +9,7 @@ import ./make-test-python.nix ({ ... }:
|
|||||||
|
|
||||||
virtualisation.emptyDiskImages = [ 4096 ];
|
virtualisation.emptyDiskImages = [ 4096 ];
|
||||||
|
|
||||||
fileSystems = lib.mkVMOverride {
|
virtualisation.fileSystems = {
|
||||||
"/home" = {
|
"/home" = {
|
||||||
device = "/dev/disk/by-label/aux";
|
device = "/dev/disk/by-label/aux";
|
||||||
fsType = "btrfs";
|
fsType = "btrfs";
|
||||||
|
@ -9,7 +9,7 @@ import ./make-test-python.nix ({ pkgs, ... }: {
|
|||||||
|
|
||||||
environment.systemPackages = [ pkgs.cryptsetup ];
|
environment.systemPackages = [ pkgs.cryptsetup ];
|
||||||
|
|
||||||
fileSystems = lib.mkVMOverride {
|
virtualisation.fileSystems = {
|
||||||
"/test-x-initrd-mount" = {
|
"/test-x-initrd-mount" = {
|
||||||
device = "/dev/vdb";
|
device = "/dev/vdb";
|
||||||
fsType = "ext2";
|
fsType = "ext2";
|
||||||
|
@ -29,7 +29,7 @@ let
|
|||||||
|
|
||||||
# Setup regular fileSystems machinery to ensure forceImportAll can be
|
# Setup regular fileSystems machinery to ensure forceImportAll can be
|
||||||
# tested via the regular service units.
|
# tested via the regular service units.
|
||||||
fileSystems = lib.mkVMOverride {
|
virtualisation.fileSystems = {
|
||||||
"/forcepool" = {
|
"/forcepool" = {
|
||||||
device = "forcepool";
|
device = "forcepool";
|
||||||
fsType = "zfs";
|
fsType = "zfs";
|
||||||
|
Loading…
Reference in New Issue
Block a user