Collection of image builders [maintainer=@Lassulus]
  • Nix 84.8%
  • Shell 13.9%
  • Makefile 1.3%
Find a file
zowoq 8946737ff7
Merge pull request #434 from phaer/archive
Deprecate nixos-generators in favor of nixos-rebuild build-image
2026-01-31 08:50:15 +10:00
.github build(deps): bump DeterminateSystems/update-flake-lock from 25 to 26 2025-07-07 15:55:40 +00:00
checks rename filename to fileExtension 2023-07-22 16:20:50 +02:00
formats iso: squashfsCompression defaults to zstd upstream 2024-11-11 17:00:01 +01:00
.envrc envrc: fallback if lorri is not present 2021-02-09 23:14:55 +01:00
.gitignore fix: add .direnv to gitignore 2024-03-25 13:23:13 +01:00
.gitlab-ci.yml correct variable for artifact upload 2019-12-05 00:44:55 +01:00
.included.yml CI: add nixos-generate logging output assertions 2022-05-13 11:45:22 -04:00
.mergify.yml ci(mergify): upgrade configuration to current format 2025-02-14 14:14:48 +00:00
.travis.yml Cleanup (#17) 2019-01-31 23:06:29 +01:00
all-formats.nix nix fmt 2024-10-29 22:18:44 +01:00
configuration.nix configuration.nix: fix eval with nixpkgs unstable 2025-03-21 15:38:44 +01:00
default.nix default.nix: quote urls 2024-08-12 06:36:50 +00:00
flake.lock flake.lock: Update 2025-01-13 01:08:43 +00:00
flake.nix update flake.lock 2024-10-30 09:29:04 +01:00
format-module.nix deprecate nixos-generators via README update & eval warning 2026-01-28 18:15:53 +01:00
garnix.yaml switch to garnix ci for linux 2023-06-19 08:22:15 +07:00
lib.nix No lib.mkForce in system.build.kexec_tarball def'n 2022-06-14 21:32:25 -04:00
LICENSE add license 2019-01-17 17:38:32 +01:00
Makefile No lib.mkForce in system.build.kexec_tarball def'n 2022-06-14 21:32:25 -04:00
nixos-generate fix: Pass --option to all nix-* commands 2025-03-01 11:58:01 +01:00
nixos-generate.nix Use virtualisation.diskSize instead of specialArg 2024-10-29 22:19:02 +01:00
package.nix package.nix: add missing gawk 2024-08-12 06:36:50 +00:00
README.md deprecate nixos-generators via README update & eval warning 2026-01-28 18:15:53 +01:00
shell.nix shell.nix: replace url literal with string url 2025-11-26 21:14:09 +01:00

deprecated: nixos-generators

Starting with NixOS 25.05, most of nixos-generators has been upstreamed into nixpkgs.

So we believe it's time to retire nixos-generators, a good 8 years after its initial commit and after countless built images. Please let us know if you run into any trouble, such as missing features, during the migration.

The main, user-visible difference is the new nixos-rebuild build-image command, which replaces the venerable nixos-generate. Check its manual section or below to see how it works.

Usage of nixos-rebuild build-images

To build an ISO image, using the new nixos-rebuild build-image, run:

nixos-rebuild build-image --image-variant iso

Or to explicitly specifiy the path to your NixOS configuration as well as the nixpkgs checkout to use:

NIX_PATH=nixpkgs=../nixpkgs NIXOS_CONFIG="/etc/nixos/nixos-configuration.nix" nixos-rebuild build-image --image-variant iso

...with Flakes

To build a simple ISO image, from a nixosConfigurations.myhost output of your flake, run:

nixos-rebuild build-image --image-variant iso --flake .#myhost

Or, if you prefer to expose an installable similar to the old nixos-generators.nixosGenerate nix function, you could use the right attribute of system.build.images:

packages.x86_64-linux.myhost-iso = self.nixosConfigurations.myhost.config.system.build.images.iso

Formats of nixos-generators

The third column describes whether they are supported image variants in nixos-rebuild build-image:

format description supported in nixpkgs
amazon Amazon EC2 image
azure Microsoft azure image (Generation 1 / VHD)
cloudstack qcow2 image for cloudstack.
do Digital Ocean image
docker Docker image (uses systemd to run, probably only works in podman)
gce Google Compute image
hyperv Hyper-V Image (Generation 2 / VHDX)
install-iso Installer ISO (called iso-installer)
install-iso-hyperv Installer ISO with enabled hyper-v support use the hyperv variant and customize it.
iso ISO
kexec kexec tarball (extract to / and run /kexec_nixos)
kexec-bundle same as before, but it's just an executable Use the kexec variant above.
kubevirt KubeVirt image
linode Linode image
lxc create a tarball which is importable as an lxc container, use together with lxc-metadata
lxc-metadata the necessary metadata for the lxc image to start, usage: lxc image import $(nixos-generate -f lxc-metadata) $(nixos-generate -f lxc)
openstack qcow2 image for openstack
proxmox VMA file for proxmox
proxmox-lxc LXC template for proxmox
qcow qcow2 image
qcow-efi qcow2 image with efi support
raw raw image with bios/mbr. for physical hardware, see the 'raw and raw-efi' section
raw-efi raw image with efi support. for physical hardware, see the 'raw and raw-efi' section
sd-aarch64 Like sd-aarch64-installer, but does not use default installer image config. use sd-card and set system to aarch64-linux
sd-aarch64-installer create an installer sd card for aarch64. For cross compiling use --system aarch64-linux and read the cross-compile section. use sd-card and set system to aarch64-linux
sd-x86_64 sd card image for x86_64 systems use sd-card and set system to x86_64-linux
vagrant-virtualbox VirtualBox image for Vagrant
virtualbox virtualbox VM
vm only used as a qemu-kvm runner use nixos-rebuild build-vm
vm-bootloader same as vm, but uses a real bootloader instead of netbooting use nixos-rebuild build-vm-with-bootloader
vm-nogui same as vm, but without a GUI use nixos-rebuild build-vm and customize it.
vmware VMWare image (VMDK)