NixOS is a linux distribution based on a purely functional package manager. This project builds vagrant .box images.
stable
First update the ISO urls and checksums to the latest NixOS release with make update
,
otherwise checksum verification will fail when packer
is invoked.
Alternatively you can call gen_template.rb
and iso_urls_update.rb
scripts manually.
First install packer and virtualbox.
These packer builders are currently supported:
- Virtualbox
- qemu / libvirt
- VMware
- Hyper-V
Take a look at the different make build
targets in the Makefile
to build your image.
e.g.: $ make build-x86_64
If you're building on a host that does not support Makefile, here are some examples:
packer build --only=virtualbox-iso nixos-i686.json
packer build --only=qemu nixos-x86_64.json
packer build --only=vmware-iso nixos-x86_64.json
packer build --only=hyperv-iso nixos-x86_64.json
The vagrant .box image is now ready to go and you can use it in vagrant. Add it as follows:
e.g.:
vagrant box add nixos-box-20.09-x86_64 nixos-20.09-virtualbox-x86_64.box
Create a vagrant file:
$ vagrant init nixos64
Make sure that config.vm.box
param of your Vagrantfile matches the name of your added box. For the example above:
config.vm.box = nixos-box-20.09-x86_64
You can skip renaming config.vm.box
if you create your Vagrantfile using the proper box name: $ vagrant init nixos-box-20.09-x86_64
Start the vagrant environment:
$ vagrant up
Also have a look at the accompanying nixos vagrant plugin: https://github.com/nix-community/vagrant-nixos-plugin
If you build on a Windows OS, please make sure you keep the unix file encoding of the generated configuration files (see issue #30)
Copyright 2015 under the MIT