X-Git-Url: http://git.scottworley.com/nixos-qemu-vm-isolation/blobdiff_plain/f78c24af1d3a186131093427d1b454600e9aa973..HEAD:/modules/qemu-vm-isolation.nix diff --git a/modules/qemu-vm-isolation.nix b/modules/qemu-vm-isolation.nix index bdf95e6..bea4174 100644 --- a/modules/qemu-vm-isolation.nix +++ b/modules/qemu-vm-isolation.nix @@ -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";