-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtemplate.json
66 lines (66 loc) · 2.68 KB
/
template.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
{
"variables": {
"swap_size": "",
"disk_size": "20000",
"memmory_size": "4096",
"cpus": "4",
"vm_name": "nixos-16.09-x86_64",
"iso_url": "https://d3g5gsiof5omrk.cloudfront.net/nixos/16.09/nixos-16.09.1694.019dcc3/nixos-minimal-16.09.1694.019dcc3-x86_64-linux.iso",
"iso_checksum_type": "sha256",
"iso_checksum": "e44768129e7648dd590f6029162a34ba6897db9737043c7fabe7443b21de06fc"
},
"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>",
"curl http://{{ .HTTPIP }}:{{ .HTTPPort }}/emacs.nix > /mnt/etc/nixos/emacs.nix<enter><wait>",
"nixos-install && reboot<enter>"
],
"guest_additions_mode": "disable",
"guest_os_type": "Linux_64",
"http_directory": "nixos",
"iso_checksum": "{{ user `iso_checksum` }}",
"iso_checksum_type": "{{ user `iso_checksum_type` }}",
"iso_url": "{{ user `iso_url` }}",
"shutdown_command": "sudo shutdown -h now",
"ssh_username": "root",
"ssh_private_key_file": "keys/vagrant.key",
"ssh_wait_timeout": "20m",
"virtualbox_version_file": ".vbox_version",
"vboxmanage": [
["modifyvm", "{{.Name}}", "--memory", "{{ user `memmory_size` }}"],
["modifyvm", "{{.Name}}", "--cpus", "{{ user `cpus` }}"]
]
}],
"provisioners": [{
"type": "shell",
"execute_command": "sudo sh '{{.Path}}'",
"script": "scripts/postinstall.sh"
},
{
"type": "file",
"source": "provision/.emacs",
"destination": "/home/vagrant/.emacs"
}
],
"post-processors": [{
"type": "vagrant",
"output": "{{ user `vm_name` }}-{{.Provider}}.box"
}]
}