packer-nixos/template.json

55 lines
1.5 KiB
JSON

{
"builders": [
{
"type": "virtualbox-iso",
"boot_wait": "1m",
"boot_command": [
"root<enter>",
"stop sshd<enter>",
"fdisk /dev/sda<enter>",
"n",
"<enter><enter><enter><enter><enter>",
"a<enter>",
"1<enter>",
"w<enter>",
"<wait>",
"mkfs.ext4 -j -L nixos /dev/sda1<enter><wait5>",
"mount LABEL=nixos /mnt<enter><wait>",
"nixos-generate-config --root /mnt<enter><wait>",
"curl http://{{ .HTTPIP }}:{{ .HTTPPort }}/basic.nix > /mnt/etc/nixos/configuration.nix<enter><wait>",
"nixos-install && reboot<enter>"
],
"guest_additions_mode": "disable",
"guest_os_type": "Linux_64",
"http_directory": "nixos",
"iso_checksum": "e6193d70d283d05795cb07422689d1cd",
"iso_checksum_type": "md5",
"iso_url": "http://releases.nixos.org/nixos/13.10/nixos-13.10.35608.1e7192a/nixos-minimal-13.10.35608.1e7192a-x86_64-linux.iso",
"shutdown_command": "sudo shutdown -h now",
"ssh_username": "root",
"ssh_key_path": "keys/install.key",
"ssh_wait_timeout": "10m",
"virtualbox_version_file": ".vbox_version"
}
],
"provisioners": [
{
"type": "file",
"source": "nixos/",
"destination": "/etc/nixos"
},
{
"type": "shell",
"execute_command": "sudo sh '{{.Path}}'",
"script": "scripts/postinstall.sh"
}
],
"post-processors": [
{
"type": "vagrant",
"output": "cycle-13.10-x86_64-{{.Provider}}.box"
}
]
}