Collection of image builders [maintainer=@Lassulus]
Branch: master
Clone or download
zimbatm and Lassulus Cleanup (#17)
* rename eval-format.nix to nixos-generate.nix

Make it clear that it's meant to be used by the nixos-generate script

* rename config.nix to configuration.nix

Bring the name closer to /etc/nixos/configuration.nix

* fix the NIXOS_CONFIG

this is the env name that nixos-rebuild uses

* use -I to load the configuration and format

This has a nice side-effect of allowing URLs as configuration

* add Travis CI

* cleanSource

* gitignore nix result files

* use modulesPath everywhere

this makes sure that the passed pkgs in nixos-generate.nix is the same
one we use to load these other modules

* use toString to avoid evaluation error
Latest commit 0cce792 Feb 1, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
formats Cleanup (#17) Jan 31, 2019
.gitignore Cleanup (#17) Jan 31, 2019
.travis.yml Cleanup (#17) Jan 31, 2019
LICENSE add license Jan 17, 2019
Makefile Cleanup (#17) Jan 31, 2019 Cleanup (#17) Jan 31, 2019
configuration.nix Cleanup (#17) Jan 31, 2019
default.nix Cleanup (#17) Jan 31, 2019
nixos-generate Cleanup (#17) Jan 31, 2019
nixos-generate.nix Cleanup (#17) Jan 31, 2019

nixos-generators - one config, multiple formats

The nixos-generators project allows to take the same NixOS configuration, and generate outputs for different target formats.

Just put your stuff into the configuration.nix and then call one of the image builders.

for example:

./nixos-generate -f iso


./nixos-generate -f iso -c /etc/nixos/configuration.nix

it echoes the path to a iso image, which you then can flash onto an usb-stick or mount & boot in a virtual machine.


nixos-generators can be installed from source into the user profile like this:

$ nix-env -f -i

Supported formats

format description
azure Microsoft azure image
gce Google Compute Image
install-iso Installer ISO
iso ISO
kexec kexec tarball (extract to / and run /kexec_nixos)
kexec-bundle same as before, but it's just an executable
openstack qcow2 image for openstack
qcow2 qcow2 image
raw raw image
virtualbox virtualbox VM
vm only used as a qemu-kvm runner
vm-nogui same as before, but without a GUI


Run ./nixos-generate --help for detailed usage information


This project is licensed under the terms of the MIT license.