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
|
||||
# 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";
|
||||
|
@ -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";
|
||||
|
@ -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";
|
||||
|
@ -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";
|
||||
|
@ -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";
|
||||
|
@ -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";
|
||||
|
@ -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" ];
|
||||
};
|
||||
|
@ -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";
|
||||
|
@ -40,7 +40,7 @@ in
|
||||
networking.domain = "nfs.test";
|
||||
networking.hostName = "client";
|
||||
|
||||
fileSystems = lib.mkVMOverride
|
||||
virtualisation.fileSystems =
|
||||
{ "/data" = {
|
||||
device = "server.nfs.test:/";
|
||||
fsType = "nfs";
|
||||
|
@ -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";
|
||||
|
@ -9,7 +9,7 @@ let
|
||||
|
||||
virtualisation.emptyDiskImages = [ 4096 ];
|
||||
|
||||
fileSystems = pkgs.lib.mkVMOverride
|
||||
virtualisation.fileSystems =
|
||||
{ "/data" =
|
||||
{ device = "/dev/disk/by-label/data";
|
||||
fsType = "ext4";
|
||||
|
@ -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";
|
||||
|
@ -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";
|
||||
|
@ -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";
|
||||
|
@ -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";
|
||||
|
Loading…
Reference in New Issue
Block a user