From e4f516e113f01a72dc745e344ebba2fd234a21d8 Mon Sep 17 00:00:00 2001 From: Scott Worley Date: Fri, 21 Jul 2023 03:00:54 -0700 Subject: [PATCH] Follow NixOS PR 236656's changes about device naming ... as we update flake.lock to a nixpkgs rev that includes that PR. --- flake.lock | 6 +++--- modules/qemu-vm-isolation.nix | 12 ++---------- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/flake.lock b/flake.lock index 0ec3471..74c2835 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1686960236, - "narHash": "sha256-AYCC9rXNLpUWzD9hm+askOfpliLEC9kwAo7ITJc4HIw=", + "lastModified": 1689850295, + "narHash": "sha256-fUYf6WdQlhd2H+3aR8jST5dhFH1d0eE22aes8fNIfyk=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "04af42f3b31dba0ef742d254456dc4c14eedac86", + "rev": "5df4d78d54f7a34e9ea1f84a22b4fd9baebc68d0", "type": "github" }, "original": { 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"; -- 2.44.1