diff --git a/nixos/modules/virtualisation/qemu-vm.nix b/nixos/modules/virtualisation/qemu-vm.nix index 6af5848b1682..b7a03eaac751 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 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) { diff --git a/nixos/tests/containers-bridge.nix b/nixos/tests/containers-bridge.nix index 12fa67c8b015..a1b0c9469d83 100644 --- a/nixos/tests/containers-bridge.nix +++ b/nixos/tests/containers-bridge.nix @@ -56,7 +56,7 @@ import ./make-test-python.nix ({ pkgs, lib, ... }: { }; - virtualisation.pathsInNixDB = [ pkgs.stdenv ]; + virtualisation.additionalPaths = [ pkgs.stdenv ]; }; testScript = '' diff --git a/nixos/tests/containers-extra_veth.nix b/nixos/tests/containers-extra_veth.nix index cbbb25258325..172409f56e89 100644 --- a/nixos/tests/containers-extra_veth.nix +++ b/nixos/tests/containers-extra_veth.nix @@ -45,7 +45,7 @@ import ./make-test-python.nix ({ pkgs, lib, ... }: { }; }; - virtualisation.pathsInNixDB = [ pkgs.stdenv ]; + virtualisation.additionalPaths = [ pkgs.stdenv ]; }; testScript = diff --git a/nixos/tests/containers-imperative.nix b/nixos/tests/containers-imperative.nix index 1dcccfc306a3..361160b1fdc2 100644 --- a/nixos/tests/containers-imperative.nix +++ b/nixos/tests/containers-imperative.nix @@ -17,7 +17,7 @@ import ./make-test-python.nix ({ pkgs, lib, ... }: { virtualisation.memorySize = 1024; # Make sure we always have all the required dependencies for creating a # container available within the VM, because we don't have network access. - virtualisation.pathsInNixDB = let + virtualisation.additionalPaths = let emptyContainer = import ../lib/eval-config.nix { inherit (config.nixpkgs.localSystem) system; modules = lib.singleton { diff --git a/nixos/tests/containers-ip.nix b/nixos/tests/containers-ip.nix index 5abea2dbad9f..8fc42dab6241 100644 --- a/nixos/tests/containers-ip.nix +++ b/nixos/tests/containers-ip.nix @@ -27,7 +27,7 @@ in import ./make-test-python.nix ({ pkgs, lib, ... }: { containers.webserver4 = webserverFor "10.231.136.1" "10.231.136.2"; containers.webserver6 = webserverFor "fc00::2" "fc00::1"; - virtualisation.pathsInNixDB = [ pkgs.stdenv ]; + virtualisation.additionalPaths = [ pkgs.stdenv ]; }; testScript = { nodes, ... }: '' diff --git a/nixos/tests/containers-portforward.nix b/nixos/tests/containers-portforward.nix index 221a6f50efd1..e21f6cee76a9 100644 --- a/nixos/tests/containers-portforward.nix +++ b/nixos/tests/containers-portforward.nix @@ -29,7 +29,7 @@ import ./make-test-python.nix ({ pkgs, lib, ... }: { }; }; - virtualisation.pathsInNixDB = [ pkgs.stdenv ]; + virtualisation.additionalPaths = [ pkgs.stdenv ]; }; testScript = diff --git a/nixos/tests/containers-tmpfs.nix b/nixos/tests/containers-tmpfs.nix index fd9f9a252ca8..0185c2d91f23 100644 --- a/nixos/tests/containers-tmpfs.nix +++ b/nixos/tests/containers-tmpfs.nix @@ -26,7 +26,7 @@ import ./make-test-python.nix ({ pkgs, lib, ... }: { config = { }; }; - virtualisation.pathsInNixDB = [ pkgs.stdenv ]; + virtualisation.additionalPaths = [ pkgs.stdenv ]; }; testScript = ''