aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'README.md')
-rw-r--r--README.md18
1 files changed, 16 insertions, 2 deletions
diff --git a/README.md b/README.md
index c37b1fb..2b6446a 100644
--- a/README.md
+++ b/README.md
@@ -6,8 +6,9 @@ console. Boots in about a second and a quarter. Stable Nix, no flakes.
The guest gets:
-- the host's Nix store, read-only, with its own closure from a local image
- for speed, and a writable layer on top, so nix and `nix-shell` work;
+- the host's Nix store, read-only, with its own closure from local images
+ for speed (one per layer, see below), 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`;
@@ -73,6 +74,19 @@ guest, so changes to it show up right away, but evaluating is slow;
not show up while the guest runs). Other modes: `mmap`, `readahead`,
`none` (the default).
+The guest's system can be built in layers, each a NixOS module on top of
+the ones before (the first on top of the base system):
+
+```sh
+nix-build pkgs/run-firecracker-vm --arg layers '[ ./base-tools.nix ./my-service.nix ]'
+```
+
+The guest runs the top layer's system. Each layer gets its own image,
+with only the store paths the layers below don't have, so the base
+image, and those of layers below, stay the same whatever goes on top:
+a service layer costs a small image of its own. Changing a layer
+changes the images of the layers above it.
+
To use a cut-down kernel, based on Firecracker's recommended guest
configuration, instead of `linuxPackages_latest`: