about summary refs log tree commit diff
path: root/nixos/modules
diff options
context:
space:
mode:
authortalyz <kim.lindberger@gmail.com>2021-10-06 19:19:29 +0200
committerYuka <yuka@yuka.dev>2021-10-28 12:55:01 +0200
commitaf9f6d9a2aeb279408bcbb90db16ef3f727e2601 (patch)
tree65507f4953525990ee1221d45216ee4745eed84f /nixos/modules
parent84839b395f5740789af7a843aaeea80ac2f6f60b (diff)
nixos/qemu-vm: Rename pathsInNixDB to additionalPaths
pathsInNixDB isn't a very accurate name when a Nix store image is
built (virtualisation.useNixStoreImage); rename it to additionalPaths,
which should be general enough to cover both cases.
Diffstat (limited to 'nixos/modules')
-rw-r--r--nixos/modules/virtualisation/qemu-vm.nix21
1 files changed, 14 insertions, 7 deletions
diff --git a/nixos/modules/virtualisation/qemu-vm.nix b/nixos/modules/virtualisation/qemu-vm.nix
index 6af5848b16828..b7a03eaac7516 100644
--- a/nixos/modules/virtualisation/qemu-vm.nix
+++ b/nixos/modules/virtualisation/qemu-vm.nix
@@ -177,7 +177,7 @@ let
     '';
 
 
-  regInfo = pkgs.closureInfo { rootPaths = config.virtualisation.pathsInNixDB; };
+  regInfo = pkgs.closureInfo { rootPaths = config.virtualisation.additionalPaths; };
 
 
   # Generate a hard disk image containing a /boot partition and GRUB
@@ -286,6 +286,7 @@ in
 {
   imports = [
     ../profiles/qemu-guest.nix
+    (mkRenamedOptionModule [ "virtualisation" "pathsInNixDB" ] [ "virtualisation" "additionalPaths" ])
   ];
 
   options = {
@@ -417,17 +418,23 @@ in
           '';
       };
 
-    virtualisation.pathsInNixDB =
+    virtualisation.additionalPaths =
       mkOption {
         type = types.listOf types.path;
         default = [];
         description =
           ''
-            The list of paths whose closure is registered in the Nix
-            database in the VM.  All other paths in the host Nix store
+            A list of paths whose closure should be made available to
+            the VM.
+
+            When 9p is used, the closure is registered in the Nix
+            database in the VM. All other paths in the host Nix store
             appear in the guest Nix store as well, but are considered
             garbage (because they are not registered in the Nix
-            database in the guest).
+            database of the guest).
+
+            When <option>virtualisation.useNixStoreImage</option> is
+            set, the closure is copied to the Nix store image.
           '';
       };
 
@@ -772,7 +779,7 @@ in
       '';
 
     # After booting, register the closure of the paths in
-    # `virtualisation.pathsInNixDB' in the Nix database in the VM.  This
+    # `virtualisation.additionalPaths' in the Nix database in the VM.  This
     # allows Nix operations to work in the VM.  The path to the
     # registration file is passed through the kernel command line to
     # allow `system.build.toplevel' to be included.  (If we had a direct
@@ -791,7 +798,7 @@ in
 
     virtualisation.bootDevice = mkDefault (driveDeviceName 1);
 
-    virtualisation.pathsInNixDB = [ config.system.build.toplevel ];
+    virtualisation.additionalPaths = [ config.system.build.toplevel ];
 
     virtualisation.sharedDirectories = {
       nix-store = mkIf (!cfg.useNixStoreImage) {