about summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorRaito Bezarius <masterancpp@gmail.com>2023-04-12 19:55:43 +0200
committerRaito Bezarius <masterancpp@gmail.com>2023-04-21 13:00:19 +0200
commit614b83a3285ca44650473e73f9777d7c41fe88a1 (patch)
tree70d25ac5dd57572d26cc30978aa14a558606cfee /nixos
parente3a41f3fec8ddfc9e20df2e10f49c464525defa3 (diff)
nixos/virtualisation/qemu-vm: remove persistBootDevice option
This option has been introduced in 678eed323ffd90117472cd432ebe85dddaff07f1 without realizing there was this
PR inflight, unfortunately, it collide with what this PR does and make
it irrelevant.

Therefore, I remove it here.
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/virtualisation/qemu-vm.nix19
-rw-r--r--nixos/tests/initrd-secrets-changing.nix1
2 files changed, 1 insertions, 19 deletions
diff --git a/nixos/modules/virtualisation/qemu-vm.nix b/nixos/modules/virtualisation/qemu-vm.nix
index 2aa8a36a1cfc7..0a682fff4103a 100644
--- a/nixos/modules/virtualisation/qemu-vm.nix
+++ b/nixos/modules/virtualisation/qemu-vm.nix
@@ -171,12 +171,6 @@ let
 
       ${lib.optionalString cfg.useBootLoader
       ''
-        if ${if !cfg.persistBootDevice then "true" else "! test -e $TMPDIR/disk.img"}; then
-          # Create a writable copy/snapshot of the boot disk.
-          # A writable boot disk can be booted from automatically.
-          ${qemu}/bin/qemu-img create -f qcow2 -F qcow2 -b ${bootDisk}/disk.img "$TMPDIR/disk.img"
-        fi
-
         NIX_EFI_VARS=$(readlink -f "''${NIX_EFI_VARS:-${config.system.name}-efi-vars.fd}")
 
         ${lib.optionalString cfg.useEFIBoot
@@ -285,7 +279,7 @@ in
     (mkRenamedOptionModule [ "virtualisation" "pathsInNixDB" ] [ "virtualisation" "additionalPaths" ])
     (mkRemovedOptionModule [ "virtualisation" "bootDevice" ] "This option was renamed to `virtualisation.rootDevice`, as it was incorrectly named and misleading. Take the time to review what you want to do and look at the new options like `virtualisation.{bootLoaderDevice, bootPartition}`, open an issue in case of issues.")
     (mkRemovedOptionModule [ "virtualisation" "efiVars" ] "This option was removed, it is possible to provide a template UEFI variable with `virtualisation.efi.variables` ; if this option is important to you, open an issue")
-    (mkRemovedOptionModule [ "virtualisation" "persistBootDevice" ] "Boot device is always persisted if you use a bootloader through the root disk image ; if this does not work for your usecase, please examine carefully what `virtualisation.{bootLoaderDevice, rootDevice, bootPartition}` options offers you and open an issue explaining your need.`")
+    (mkRemovedOptionModule [ "virtualisation" "persistBootDevice" ] "Boot device is always persisted if you use a bootloader through the root disk image ; if this does not work for your usecase, please examine carefully what `virtualisation.{bootDevice, rootDevice, bootPartition}` options offer you and open an issue explaining your need.`")
   ];
 
   options = {
@@ -384,17 +378,6 @@ in
           '';
       };
 
-    virtualisation.persistBootDevice =
-      mkOption {
-        type = types.bool;
-        default = false;
-        description =
-          lib.mdDoc ''
-            If useBootLoader is specified, whether to recreate the boot device
-            on each instantiaton or allow it to persist.
-            '';
-      };
-
     virtualisation.emptyDiskImages =
       mkOption {
         type = types.listOf types.ints.positive;
diff --git a/nixos/tests/initrd-secrets-changing.nix b/nixos/tests/initrd-secrets-changing.nix
index 775c69d0142db..d6f9ef9ced83a 100644
--- a/nixos/tests/initrd-secrets-changing.nix
+++ b/nixos/tests/initrd-secrets-changing.nix
@@ -15,7 +15,6 @@ testing.makeTest {
 
   nodes.machine = { ... }: {
     virtualisation.useBootLoader = true;
-    virtualisation.persistBootDevice = true;
 
     boot.loader.grub.device = "/dev/vda";