Automatically build (netboot) images for NixOS [maintainer=@Mic92]
Find a file
github-actions[bot] 4b69049846 flake.lock: Update
Flake lock file updates:

• Updated input 'nixos-2211':
    'github:NixOS/nixpkgs/4bbbb536760e6176c4b127a8ef67978f80d06cff' (2023-04-16)
  → 'github:NixOS/nixpkgs/3d302c67ab8647327dba84fbdb443cdbf0e82744' (2023-04-19)
• Updated input 'nixos-unstable':
    'github:NixOS/nixpkgs/b9e9372e6be61a91f0b13fd5eb88b34ccd6d16ff' (2023-04-16)
  → 'github:NixOS/nixpkgs/cafa2f02fbbcade5c5c257c190061da555d90913' (2023-04-19)
2023-04-20 00:57:20 +00:00
.github build(deps): bump DeterminateSystems/update-flake-lock from 18 to 19 2023-04-10 10:57:09 +00:00
nix/kexec-installer kexec-installer: don't die on missing json keys 2023-03-23 08:41:35 +00:00
bors.toml kexec-installer: add bors 2023-01-05 12:26:09 +01:00
build-images.sh build images from flake 2022-12-16 15:27:57 +01:00
flake.lock flake.lock: Update 2023-04-20 00:57:20 +00:00
flake.nix also run shellcheck on kexec-run script 2023-01-24 15:54:43 +01:00
LICENSE Initial commit 2021-06-10 05:52:46 +01:00
README.md drop kexec-bundle 2022-12-16 15:27:16 +01:00

nixos-images

Automatically weekly updated images for NixOS. This project is intended to extend the images created by hydra.nixos.org. We are currently creating the images listed below:

Netboot images

You can boot the netboot image using this ipxe script. It consists of the kernel image and initrd.

Kexec tarballs

Kexec is a mechanism in Linux to load a new kernel from a running Linux to replace the current kernel. This is useful for booting the Nixos installer from existing Linux distributions, such as server provider that do not offer a NixOS option. After running kexec, the NixOS installer exists only in memory. At the time of writing, this requires at least 2.5GB of physical RAM (swap does not count) in the system. If not enough RAM is available, the initrd cannot be loaded. Because the NixOS runs only in RAM, users can reformat all the system's discs to prepare for a new NixOS installation.

It can be booted as follows by running these commands as root:

curl -L https://github.com/nix-community/nixos-images/releases/download/nixos-unstable/nixos-kexec-installer-x86_64-linux.tar.gz | tar -xzf- -C /root
/root/kexec/run

The kexec installer comes with the following features:

  • Re-uses ssh host keys from the sshd to not break .ssh/known_hosts
  • Authorized ssh keys are read from /root/.ssh/authorized_keys, /root/.ssh/authorized_keys2 and /etc/ssh/authorized_keys.d/root
  • (experimental, only tested for nixos-unstable) Static ip addresses and routes are restored after reboot. Interface that had dynamic addresses before are configured with DHCP and to accept prefixes from ipv6 router advertisment

The actual kexec happens with a slight delay (6s). This allows for easier integration into automated nixos installation scripts, since you can cleanly disconnect from the running machine before the kexec takes place. The tarball is also designed to be run from NixOS, which can be useful for new installations