packer-nixos/template.json
2014-02-03 02:32:28 +00:00

57 lines
1.9 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 }}/configuration.nix > /mnt/etc/nixos/configuration.nix<enter><wait>",
"curl http://{{ .HTTPIP }}:{{ .HTTPPort }}/guest-virtualbox.nix > /mnt/etc/nixos/guest.nix<enter><wait>",
"curl http://{{ .HTTPIP }}:{{ .HTTPPort }}/users-vagrant.nix > /mnt/etc/nixos/users.nix<enter><wait>",
"curl http://{{ .HTTPIP }}:{{ .HTTPPort }}/vagrant.nix > /mnt/etc/nixos/vagrant.nix<enter><wait>",
"nixos-install && reboot<enter>"
],
"guest_additions_mode": "disable",
"guest_os_type": "Linux_64",
"http_directory": "nixos",
"iso_checksum": "48395b4bd21675703c87cfae1feb68ed",
"iso_checksum_type": "md5",
"iso_url": "http://releases.nixos.org/nixos/unstable/nixos-14.02pre38596.1dd0e05/nixos-minimal-14.02pre38596.1dd0e05-x86_64-linux.iso",
"shutdown_command": "sudo shutdown -h now",
"ssh_username": "root",
"ssh_key_path": "keys/vagrant.key",
"ssh_wait_timeout": "20m",
"virtualbox_version_file": ".vbox_version",
"vboxmanage": [
["modifyvm", "{{.Name}}", "--memory", "1024"],
["modifyvm", "{{.Name}}", "--cpus", "2"]
]
}
],
"provisioners": [
{
"type": "shell",
"execute_command": "sudo sh '{{.Path}}'",
"script": "scripts/postinstall.sh"
}
],
"post-processors": [
{
"type": "vagrant",
"output": "nixos-14.02-x86_64-{{.Provider}}.box"
}
]
}