diff options
author | talyz <kim.lindberger@gmail.com> | 2021-10-06 19:19:29 +0200 |
---|---|---|
committer | Yuka <yuka@yuka.dev> | 2021-10-28 12:55:01 +0200 |
commit | af9f6d9a2aeb279408bcbb90db16ef3f727e2601 (patch) | |
tree | 65507f4953525990ee1221d45216ee4745eed84f /nixos | |
parent | 84839b395f5740789af7a843aaeea80ac2f6f60b (diff) | |
download | nixlib-af9f6d9a2aeb279408bcbb90db16ef3f727e2601.tar nixlib-af9f6d9a2aeb279408bcbb90db16ef3f727e2601.tar.gz nixlib-af9f6d9a2aeb279408bcbb90db16ef3f727e2601.tar.bz2 nixlib-af9f6d9a2aeb279408bcbb90db16ef3f727e2601.tar.lz nixlib-af9f6d9a2aeb279408bcbb90db16ef3f727e2601.tar.xz nixlib-af9f6d9a2aeb279408bcbb90db16ef3f727e2601.tar.zst nixlib-af9f6d9a2aeb279408bcbb90db16ef3f727e2601.zip |
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')
-rw-r--r-- | nixos/modules/virtualisation/qemu-vm.nix | 21 | ||||
-rw-r--r-- | nixos/tests/containers-bridge.nix | 2 | ||||
-rw-r--r-- | nixos/tests/containers-extra_veth.nix | 2 | ||||
-rw-r--r-- | nixos/tests/containers-imperative.nix | 2 | ||||
-rw-r--r-- | nixos/tests/containers-ip.nix | 2 | ||||
-rw-r--r-- | nixos/tests/containers-portforward.nix | 2 | ||||
-rw-r--r-- | nixos/tests/containers-tmpfs.nix | 2 |
7 files changed, 20 insertions, 13 deletions
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 <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) { 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 = '' |