aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-11-16 23:58:26 +0000
committertv <tv@krebsco.de>2026-11-16 23:58:26 +0000
commit9687fe329ccc88b13d3614a8d8d332a3ea3dcab9 (patch)
tree55d2a76c25dd12f908f1cd9667aa14376be70fb9 /README.md
parentfb7a621f580caf6d31e0b807d070a7231416538d (diff)
serve nixpkgs to the guest via 9P instead of from the store
A <nixpkgs> outside the store got copied (i.e. hashed) to the store on every evaluation, for the guest's NIX_PATH, so no-op builds still took ~25s with a checkout. Now a third 9P server serves nixpkgs from wherever it is, read-only, at /nixpkgs in the guest, which NIX_PATH points to. It's in neither the closure nor the registration any more, and run-firecracker-vm --nixpkgs DIR can serve another one.
Diffstat (limited to 'README.md')
-rw-r--r--README.md4
1 files changed, 4 insertions, 0 deletions
diff --git a/README.md b/README.md
index 6435038..4174b03 100644
--- a/README.md
+++ b/README.md
@@ -10,6 +10,7 @@ The guest gets:
for speed, and a writable layer on top, so nix and `nix-shell` work;
- `/xchg`: the directory `xchg` in the current working directory, shared
with the host (and with other VMs started in the same directory);
+- `/nixpkgs`: the host's nixpkgs, read-only, on the guest's `NIX_PATH`;
- network access only to HTTPS, through a proxy on the host that allows
only listed domains, optionally only listed paths.
@@ -54,6 +55,9 @@ removed when the guest exits. To keep it across boots:
The file gets created (sparse, default 16G) if it doesn't exist. Only one
VM at a time can use it.
+`/nixpkgs` is the nixpkgs the guest was built from (`<nixpkgs>`, checkout
+or not); `--nixpkgs DIR` serves another one.
+
To use a cut-down kernel, based on Firecracker's recommended guest
configuration, instead of `linuxPackages_latest`: