]> git.scottworley.com Git - nixos-qemu-vm-isolation/blobdiff - modules/qemu-vm-isolation.nix
Drop support for < 23.05
[nixos-qemu-vm-isolation] / modules / qemu-vm-isolation.nix
index 00dbac139f81fc63edc05b71da92900e6560a85d..ad586ecc1af14245107efe6db9a83dc7925f4927 100644 (file)
@@ -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;
-  })
-]
+  };
+}