Create full netboot images in 15 seconds.
Go to file
2024-12-29 23:05:43 -05:00
config try install files again 2024-12-29 23:05:43 -05:00
installer added installer 2024-12-27 23:01:51 -05:00
pkgs add diskco pkg 2024-12-29 21:35:58 -05:00
flake.nix Add flake.nix 2020-11-20 16:12:10 -06:00
quickly.nix update install files 2024-12-29 22:57:02 -05:00
README.md Restructure the readme 2020-06-08 10:05:47 -04:00
test.nix Check that the store registration works (it doesn't.) 2020-06-08 09:17:49 -04:00

netboot.nix: 15 second netboot iterations

How to Use

  1. set up recursive nix on your builder (see below)
  2. add quickly.nix to your system's imports, like in ./size-test/base.nix
  3. then build your iPXE boot directory:
$ nix-build '<nixpkgs/nixos>' -I nixos-config=./size-test/base.nix -A config.system.build.ipxeBootDir
  1. boot off of ./result/netboot.ipxe.

The initial build may take a few minutes, but subsequent builds will only take a few seconds.

Setting up recursive nix

Setting up recursive Nix requires support on the build machine:

{ pkgs, ... }: {
  nix = {
    package = pkgs.nixUnstable;
    systemFeatures = [ "recursive-nix" "kvm" "nixos-test" ];
    extraOptions = ''
      experimental-features = recursive-nix
    '';
  };
}

How it works

./quickly.nix uses recursive Nix to build the initrd and squashfs filesystems more quickly, allowing for faster iteration of images. Initial testing reduced build time from 5-10 minutes per image to 15-30 seconds.

The ./size-test/build.sh test is able to build an incremental netboot image in just 12 seconds, and the initrd is not rebuilt.