aboutsummaryrefslogtreecommitdiffstats
path: root/pkgs
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/run-firecracker-vm/default.nix10
1 files changed, 7 insertions, 3 deletions
diff --git a/pkgs/run-firecracker-vm/default.nix b/pkgs/run-firecracker-vm/default.nix
index 44e9e7c..3ff3d0f 100644
--- a/pkgs/run-firecracker-vm/default.nix
+++ b/pkgs/run-firecracker-vm/default.nix
@@ -240,9 +240,13 @@ let
inherit (nixos.config.system.build) toplevel kernel initialRamdisk;
- # The host's nixpkgs, for the guest's NIX_PATH (copied to the store, if
- # it's not a store path already).
- nixpkgs = "${pkgs.path}";
+ # The host's nixpkgs, for the guest's NIX_PATH. builtins.storePath if
+ # it's in the store already, as "${pkgs.path}" would copy it to the
+ # store anyway, hashing all of nixpkgs on every evaluation (~20s).
+ nixpkgs =
+ if lib.isStorePath (toString pkgs.path)
+ then builtins.storePath (toString pkgs.path)
+ else "${pkgs.path}";
# The guest's closure, as erofs image. (Without nixpkgs, which made it
# 7 GiB, and comes from the host's store instead.)