From 26efd1b62cf514c1b90d0be0b9aab4345e8b0c21 Mon Sep 17 00:00:00 2001 From: Scott Worley Date: Thu, 20 Jul 2023 21:01:25 -0700 Subject: [PATCH 1/1] Drop support for < 23.05 --- modules/qemu-vm-isolation.nix | 65 ++++++++++++++++------------------- 1 file changed, 29 insertions(+), 36 deletions(-) diff --git a/modules/qemu-vm-isolation.nix b/modules/qemu-vm-isolation.nix index 00dbac1..ad586ec 100644 --- a/modules/qemu-vm-isolation.nix +++ b/modules/qemu-vm-isolation.nix @@ -12,45 +12,38 @@ let else "/nix/store"; -in mkMerge [ - { - - boot.initrd.availableKernelModules = [ "squashfs" ]; - - fileSystems = mkVMOverride { - "${storeMountPath}" = { - device = - lookupDriveDeviceName "nixstore" config.virtualisation.qemu.drives; - fsType = "squashfs"; - options = [ "ro" ]; - neededForBoot = true; - }; +in { + + boot.initrd.availableKernelModules = [ "squashfs" ]; + + fileSystems = mkVMOverride { + "${storeMountPath}" = { + device = + lookupDriveDeviceName "nixstore" config.virtualisation.qemu.drives; + fsType = "squashfs"; + options = [ "ro" ]; + neededForBoot = true; }; + }; - system.build.squashfsStore = - pkgs.callPackage (modulesPath + "/../lib/make-squashfs.nix") { - storeContents = config.virtualisation.additionalPaths; - }; + system.build.squashfsStore = + pkgs.callPackage (modulesPath + "/../lib/make-squashfs.nix") { + storeContents = config.virtualisation.additionalPaths; + }; - virtualisation = { + virtualisation = { - sharedDirectories = mkForce { }; + sharedDirectories = mkForce { }; - qemu.drives = [{ - name = "nixstore"; - file = "${config.system.build.squashfsStore}"; - driveExtraOpts = { - format = "raw"; - read-only = "on"; - werror = "report"; - }; - }]; + qemu.drives = [{ + name = "nixstore"; + file = "${config.system.build.squashfsStore}"; + driveExtraOpts = { + format = "raw"; + read-only = "on"; + werror = "report"; + }; + }]; - }; - } - (mkIf (lib.version < "23.05") { - # This should always have been the default. - virtualisation.bootDevice = - lookupDriveDeviceName "root" config.virtualisation.qemu.drives; - }) -] + }; +} -- 2.44.1