diff options
Diffstat (limited to 'pkgs/run-firecracker-vm/default.nix')
| -rw-r--r-- | pkgs/run-firecracker-vm/default.nix | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/pkgs/run-firecracker-vm/default.nix b/pkgs/run-firecracker-vm/default.nix index 106ec05..041bf60 100644 --- a/pkgs/run-firecracker-vm/default.nix +++ b/pkgs/run-firecracker-vm/default.nix @@ -1,7 +1,9 @@ { pkgs ? import <nixpkgs> {} -, kernelPackages ? pkgs.linuxPackages_latest - # The CA of the host's egress proxy (see modules/host), if it's there. -, caCert ? "/var/lib/fcbr0-egress/ca.pem" + # NixOS modules, part of the base system (layer 0, the first image), + # for what all layers share, like the kernel (base/kernel.nix): set in a + # layer instead, the base's kernel modules would stay in the base image, + # unused. +, base ? [ ] # NixOS modules, each a layer on top of the ones before, the first on # top of the base system (below). The guest runs the top layer's # system; its store has an image per layer, each with only the store @@ -155,7 +157,7 @@ let description = "The secrets the guest needs, by name (--secret NAME=FILE)."; }; } - ] ++ lib.take n layers; + ] ++ base ++ lib.take n layers; # nix only with layers/nix.nix, which the run script needs to know # about. @@ -175,7 +177,7 @@ let system.stateVersion = lib.trivial.release; - boot.kernelPackages = kernelPackages; + boot.kernelPackages = lib.mkDefault pkgs.linuxPackages_latest; boot.initrd.allowMissingModules = true; # e.g. ahci, efivarfs with a cut-down kernel boot.initrd.kernelModules = [ "virtio_mmio" "virtio_blk" "erofs" "vmw_vsock_virtio_transport" "9p" "9pnet_fd" "overlay" ]; boot.kernelParams = [ @@ -269,10 +271,11 @@ let networking.useDHCP = false; networking.resolvconf.enable = false; # The host resolves every name to itself and proxies TLS to allowed - # names, decrypting some with certificates from its CA, see modules/host. + # names, decrypting some with certificates from its CA, see modules/host + # (if it's there; another one: security.pki.certificateFiles). environment.etc."resolv.conf".text = "nameserver 172.16.0.1\n"; security.pki.certificateFiles = - lib.optional (builtins.pathExists caCert) (/. + caCert); + lib.optional (builtins.pathExists /var/lib/fcbr0-egress/ca.pem) /var/lib/fcbr0-egress/ca.pem; systemd.network.enable = true; systemd.network.wait-online.enable = false; systemd.network.networks.eth = { |
