Loading nixos/modules/virtualisation/qemu-vm.nix +12 −5 Original line number Diff line number Diff line Loading @@ -108,9 +108,9 @@ let set -e NIX_DISK_IMAGE=$(readlink -f "''${NIX_DISK_IMAGE:-${config.virtualisation.diskImage}}") NIX_DISK_IMAGE=$(readlink -f "''${NIX_DISK_IMAGE:-${toString config.virtualisation.diskImage}}") || test -z "$NIX_DISK_IMAGE" if ! test -e "$NIX_DISK_IMAGE"; then if test -n "$NIX_DISK_IMAGE" && ! test -e "$NIX_DISK_IMAGE"; then ${qemu}/bin/qemu-img create -f qcow2 "$NIX_DISK_IMAGE" \ ${toString config.virtualisation.diskSize}M fi Loading Loading @@ -346,7 +346,7 @@ in virtualisation.diskImage = mkOption { type = types.str; type = types.nullOr types.str; default = "./${config.system.name}.qcow2"; defaultText = literalExpression ''"./''${config.system.name}.qcow2"''; description = Loading @@ -354,6 +354,9 @@ in Path to the disk image containing the root filesystem. The image will be created on startup if it does not exist. If null, a tmpfs will be used as the root filesystem and the VM's state will not be persistent. ''; }; Loading Loading @@ -975,12 +978,12 @@ in ]; virtualisation.qemu.drives = mkMerge [ [{ (mkIf (cfg.diskImage != null) [{ name = "root"; file = ''"$NIX_DISK_IMAGE"''; driveExtraOpts.cache = "writeback"; driveExtraOpts.werror = "report"; }] }]) (mkIf cfg.useNixStoreImage [{ name = "nix-store"; file = ''"$TMPDIR"/store.img''; Loading Loading @@ -1031,6 +1034,10 @@ in "/".fsType = "ext4"; "/".autoFormat = true; } // optionalAttrs (cfg.diskImage == null) { "/".device = "tmpfs"; "/".fsType = "tmpfs"; } // optionalAttrs config.boot.tmpOnTmpfs { "/tmp" = { device = "tmpfs"; Loading Loading
nixos/modules/virtualisation/qemu-vm.nix +12 −5 Original line number Diff line number Diff line Loading @@ -108,9 +108,9 @@ let set -e NIX_DISK_IMAGE=$(readlink -f "''${NIX_DISK_IMAGE:-${config.virtualisation.diskImage}}") NIX_DISK_IMAGE=$(readlink -f "''${NIX_DISK_IMAGE:-${toString config.virtualisation.diskImage}}") || test -z "$NIX_DISK_IMAGE" if ! test -e "$NIX_DISK_IMAGE"; then if test -n "$NIX_DISK_IMAGE" && ! test -e "$NIX_DISK_IMAGE"; then ${qemu}/bin/qemu-img create -f qcow2 "$NIX_DISK_IMAGE" \ ${toString config.virtualisation.diskSize}M fi Loading Loading @@ -346,7 +346,7 @@ in virtualisation.diskImage = mkOption { type = types.str; type = types.nullOr types.str; default = "./${config.system.name}.qcow2"; defaultText = literalExpression ''"./''${config.system.name}.qcow2"''; description = Loading @@ -354,6 +354,9 @@ in Path to the disk image containing the root filesystem. The image will be created on startup if it does not exist. If null, a tmpfs will be used as the root filesystem and the VM's state will not be persistent. ''; }; Loading Loading @@ -975,12 +978,12 @@ in ]; virtualisation.qemu.drives = mkMerge [ [{ (mkIf (cfg.diskImage != null) [{ name = "root"; file = ''"$NIX_DISK_IMAGE"''; driveExtraOpts.cache = "writeback"; driveExtraOpts.werror = "report"; }] }]) (mkIf cfg.useNixStoreImage [{ name = "nix-store"; file = ''"$TMPDIR"/store.img''; Loading Loading @@ -1031,6 +1034,10 @@ in "/".fsType = "ext4"; "/".autoFormat = true; } // optionalAttrs (cfg.diskImage == null) { "/".device = "tmpfs"; "/".fsType = "tmpfs"; } // optionalAttrs config.boot.tmpOnTmpfs { "/tmp" = { device = "tmpfs"; Loading