{
	"variables": {
        "iso_url": "https://mirrors.kernel.org/archlinux/iso/{{isotime \"2006.01\"}}.01/archlinux-{{isotime \"2006.01\"}}.01-x86_64.iso",
        "iso_checksum_url": "https://mirrors.kernel.org/archlinux/iso/{{isotime \"2006.01\"}}.01/sha1sums.txt",
		"root_password": "arch",
		"username": "vagrant",
		"password": "vagrant"
	},
	"builders": [{
		"headless": true,
		"type": "virtualbox-iso",
		"iso_url": "{{ user `iso_url` }}",
		"iso_checksum": "file:{{ user `iso_checksum_url` }}",
		"vm_name": "arch-desktop",
		"guest_os_type": "ArchLinux_64",
		"guest_additions_mode": "disable",
		"virtualbox_version_file": "",
		"firmware": "efi",
		"gfx_controller": "vmsvga",
		"gfx_accelerate_3d": false,
		"gfx_vram_size": 32,
		"memory": 1024,
		"cpus": 2,
		"boot_wait": "5s",
		"boot_command": [
			"<enter><wait60s>",
			"printf \"{{user `root_password`}}\\n{{user `root_password`}}\\n\" | passwd<enter>",
			"systemctl is-active --quiet sshd.service || systemctl start sshd.service<enter>"
		],
		"iso_interface": "sata",
		"hard_drive_interface": "sata",
		"output_directory": "dist/arch-desktop",
		"ssh_username": "root",
		"ssh_password": "{{user `root_password`}}",
		"ssh_timeout": "20m",
		"shutdown_command": "systemctl poweroff"
	}],
	"provisioners": [
		{
			"type": "shell-local",
			"command": "rm -rf upload/arch-desktop.tar && tar cf upload/arch-desktop.tar ../install ../arch.sh ../setup vagrant.sh"
		},
		{
			"type": "file",
			"source": "upload",
			"destination": "upload"
		},
		{
			"type": "shell",
			"inline": [
				"mv upload/arch-desktop.tar .",
				"tar xf arch-desktop.tar",
				"rm -rf upload",
				"rm arch-desktop.tar"
			]
		},
		{
			"type": "shell-local",
			"command": "rm -rf upload/arch-desktop.tar"
		},
		{
			"type": "shell",
			"skip_clean": true,
			"environment_vars": [
				"DEBUG=y",
				"enable_hibernation=y",
				"hostname=vagrant",
				"root_password={{user `root_password`}}",
				"username={{user `username`}}",
				"password={{user `password`}}"
			],
			"script": "../setup/install.sh"
		},
		{
			"type": "shell",
			"inline": ["arch-chroot /mnt /srv/arch-desktop/vagrant.sh"]
		}
	],
	"post-processors": [
		{
			"type": "vagrant",
			"compression_level": 9,
			"output": "dist/arch-desktop.box"
		}
	]
}