]> git.scottworley.com Git - nixos-qemu-vm-isolation/blobdiff - modules/qemu-vm-isolation.nix
Follow NixOS PR 236656's changes about device naming
[nixos-qemu-vm-isolation] / modules / qemu-vm-isolation.nix
index bdf95e6d852f424ba6bc3264b421480769e1247a..bea417449b767c9c8466b39075abb85f70e8bd52 100644 (file)
@@ -1,16 +1,10 @@
 { config, lib, modulesPath, pkgs, ... }:
 let
   inherit (lib)
-    escapeShellArg findSingle mkForce mkIf mkMerge mkOption mkVMOverride
-    optional;
+    escapeShellArg mkForce mkIf mkMerge mkOption mkVMOverride optional;
 
   cfg = config.virtualisation.qemu.isolation;
 
-  lookupDriveDeviceName = driveName: driveList:
-    (findSingle (drive: drive.name == driveName)
-      (throw "Drive ${driveName} not found")
-      (throw "Multiple drives named ${driveName}") driveList).device;
-
   storeMountPath = if config.virtualisation.writableStore then
     "/nix/.ro-store"
   else
@@ -74,11 +68,10 @@ in {
 
       fileSystems = mkVMOverride {
         "${storeMountPath}" = {
-          device =
-            lookupDriveDeviceName "nixstore" config.virtualisation.qemu.drives;
           fsType = cfg.nixStoreFilesystemType;
           options = [ "ro" ];
           neededForBoot = true;
+          label = "nix-store";
         };
       };
 
@@ -90,7 +83,6 @@ in {
         sharedDirectories = mkForce { };
 
         qemu.drives = [{
-          name = "nixstore";
           file = "${config.system.build.nixStoreImage}/nixos.img";
           driveExtraOpts = {
             format = "raw";