diff options
| author | tv <tv@krebsco.de> | 2026-11-21 16:31:57 +0000 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-11-21 16:50:30 +0000 |
| commit | 5b918e0b892a3c3eeddd866170eefe2cbd7e6ba3 (patch) | |
| tree | ecbee40a8bc0c5c189d348d7b8c90af901a15aa9 /README.md | |
| parent | 4148b4543c7d776d3428d01497cfc9de3ae7c9f7 (diff) | |
run-firecracker-vm: base, modules for the base system, instead of kernelPackages and caCert
The base system could only be changed by its two arguments, and a
kernel set in a layer was a conflict with the base's plain
boot.kernelPackages = kernelPackages. Now base takes NixOS modules,
merged into the base system, i.e. layer 0 and its image, so what all
layers share goes there, the kernel above all: kernel.nix is such a
module now, and no package any more, so it moves to base/ (--arg base
'[ base/kernel.nix ]', like --arg layers '[ layers/nix.nix ]'), and the
base's linuxPackages_latest is only a default. A layer can set the
kernel, too, now, but then the base image keeps its own kernel's
modules (161M for linuxPackages_latest), unused.
caCert wasn't used: the egress proxy's CA stays where modules/host puts
it, picked up if it's there; another one is
security.pki.certificateFiles, in base or a layer.
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -197,12 +197,15 @@ a service layer costs a small image of its own, named after its file (`firecracker-layer-2-my-service.img`). 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`: +What all layers share goes into the base system, with `base`, NixOS +modules like layers', but in the base image. The kernel, for one: set +in a layer, it would leave the base's kernel modules unused in the base +image. So to use a cut-down kernel, based on Firecracker's recommended +guest configuration, instead of `linuxPackages_latest`: ```sh nix-build pkgs/run-firecracker-vm \ - --arg kernelPackages 'import pkgs/run-firecracker-vm/kernel.nix {}' + --arg base '[ base/kernel.nix ]' ``` ## Egress @@ -282,7 +285,7 @@ the list its own VM uses. - `pkgs/run-firecracker-vm/default.nix`: the guest's NixOS configuration, the Firecracker configuration, and the `run-firecracker-vm` script. -- `pkgs/run-firecracker-vm/kernel.nix`: the cut-down kernel. +- `base/kernel.nix`: the cut-down kernel, for `base`. - `layers/nix.nix`: nix, as a layer. - `layers/console.nix`: a shell on the serial console, to import into a layer. - `modules/host/default.nix`: the host's side: network, DHCP/DNS, egress |
