From 0221e9446d5861ee15029475919fcb3ce397bc16 Mon Sep 17 00:00:00 2001 From: Chris Farmiloe Date: Wed, 29 Jan 2014 12:47:06 +0000 Subject: [PATCH] Fixes for latest version of packer --- Makefile | 17 ------- README.md | 50 ++++++++----------- Vagrantfile | 5 +- ...x64-template.json => cycle64-template.json | 8 +-- nixbox-template.json.orig | 50 ------------------- nixbox32-template.json | 50 ------------------- 6 files changed, 27 insertions(+), 153 deletions(-) delete mode 100644 Makefile rename nixbox64-template.json => cycle64-template.json (90%) delete mode 100644 nixbox-template.json.orig delete mode 100644 nixbox32-template.json diff --git a/Makefile b/Makefile deleted file mode 100644 index dcac0ac..0000000 --- a/Makefile +++ /dev/null @@ -1,17 +0,0 @@ - -ISO_URL_32=http://nixos.org/releases/nixos/13.10/nixos-13.10.35455.45219b9/nixos-minimal-13.10.35455.45219b9-i686-linux.iso -ISO_MD5_32=c10f01734cb187e13068252e2cde565d -GUEST_OS_32=Linux - -ISO_URL_64=http://nixos.org/releases/nixos/13.10/nixos-13.10.35455.45219b9/nixos-minimal-13.10.35455.45219b9-x86_64-linux.iso -ISO_MD5_64=fbac8c11661028e6f9c4ec293e1329e1 -GUEST_OS_64=Linux_64 - -all: nixbox32-template.json nixbox64-template.json - -nixbox32-template.json: nixbox-template.json.orig - cat $< | sed -e 's|ISO_URL|$(ISO_URL_32)|g' -e 's|ISO_MD5|$(ISO_MD5_32)|g' -e 's|GUEST_OS|$(GUEST_OS_32)|g' -e 's|NIXBOX|nixbox32|g' > $@ - -nixbox64-template.json: nixbox-template.json.orig - cat $< | sed -e 's|ISO_URL|$(ISO_URL_64)|g' -e 's|ISO_MD5|$(ISO_MD5_64)|g' -e 's|GUEST_OS|$(GUEST_OS_64)|g' -e 's|NIXBOX|nixbox64|g' > $@ - diff --git a/README.md b/README.md index fc9b377..b2d4f58 100644 --- a/README.md +++ b/README.md @@ -1,45 +1,39 @@ -NixOS boxes for Vagrant -======================= +Base Cycle OS build scripts +=========================== -[NixOS](http://nixos.org) is a linux distribution based on a purely functional -package manager. This project builds .box images that can be used by -[vagrant](http://vagrantup.com), the VM manager. +Cycle's OS is based on [NixOS](http://nixos.org), a linux distribution with a purely functional +package manager. -Status ------- +These scripts build .box images that can be used by [vagrant](http://vagrantup.com), the VM manager, and ISO images that can be installed on bare metal. -stable - -Install -------- - -``` -vagrant box add nixbox32 http://zimbatm.s3.amazonaws.com/nixbox/nixos32-virtualbox.box -vagrant init nixbox32 -# or -vagrant box add nixbox64 http://zimbatm.s3.amazonaws.com/nixbox/nixos64-virtualbox.box -vagrant init nixbox64 -``` Building the images ------------------- -First install [packer](http://packer.io) and -[virtualbox](https://www.virtualbox.org/) +First install [packer](http://packer.io) and [virtualbox](https://www.virtualbox.org/) Then: ``` -packer build nixbox32-template.json -# or -packer build nixbox64-template.json +packer build cycle64-template.json ``` -The .box image is now ready to go and you can use it in vagrant: +The .box image is now ready to go. Install it into Vagrant via: ``` -vagrant box add nixbox32 nixbox32-virtualbox.box -# or -vagrant box add nixbox64-nixbox64-virtualbox.box +vagrant box add cycle64 cycle64-virtualbox.box +``` + + +Running the images +------------------ + +To use the box with vagrant + +``` +cd /your/project/dir +vagrant init cycle64 +vagrant up +vagrant ssh ``` diff --git a/Vagrantfile b/Vagrantfile index 53a9f71..8c87820 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -2,8 +2,5 @@ # vi: set ft=ruby : Vagrant.configure("2") do |config| - config.vm.box = 'nixos32' - config.vm.box_url = 'http://zimbatm.s3.amazonaws.com/nixbox/nixbox32-virtualbox.box' - #config.vm.box = 'nixos64' - #config.vm.box_url = 'http://zimbatm.s3.amazonaws.com/nixbox/nixbox64-virtualbox.box' + config.vm.box = 'nixbox64' end diff --git a/nixbox64-template.json b/cycle64-template.json similarity index 90% rename from nixbox64-template.json rename to cycle64-template.json index fbd6e96..45d9569 100644 --- a/nixbox64-template.json +++ b/cycle64-template.json @@ -1,7 +1,7 @@ { "builders": [ { - "type": "virtualbox", + "type": "virtualbox-iso", "boot_wait": "1m", "boot_command": [ "root", @@ -20,7 +20,7 @@ "nixos-install && reboot" ], "guest_additions_mode": "disable", - "guest_os_type": "Linux_64", + "guest_os_type": "Gentoo_64", "http_directory": "http", "iso_checksum": "fbac8c11661028e6f9c4ec293e1329e1", "iso_checksum_type": "md5", @@ -29,7 +29,7 @@ "ssh_password": "vagrant", "ssh_port": 22, "ssh_username": "vagrant", - "ssh_wait_timeout": "5m", + "ssh_wait_timeout": "10m", "virtualbox_version_file": ".vbox_version" } ], @@ -43,7 +43,7 @@ "post-processors": [ { "type": "vagrant", - "output": "nixbox64-{{.Provider}}.box" + "output": "cycle64-{{.Provider}}.box" } ] } diff --git a/nixbox-template.json.orig b/nixbox-template.json.orig deleted file mode 100644 index 806f3b1..0000000 --- a/nixbox-template.json.orig +++ /dev/null @@ -1,50 +0,0 @@ -{ - "builders": [ - { - "type": "virtualbox", - "boot_wait": "1m", - "boot_command": [ - "root", - "stop sshd", - "fdisk /dev/sda", - "n", - "", - "a", - "1", - "w", - "", - "mkfs.ext4 -j -L nixos /dev/sda1", - "mount LABEL=nixos /mnt", - "nixos-generate-config --root /mnt", - "curl http://{{ .HTTPIP }}:{{ .HTTPPort }}/configuration.nix | sed -e 's|nixbox|NIXBOX|g' > /mnt/etc/nixos/configuration.nix", - "nixos-install && reboot" - ], - "guest_additions_mode": "disable", - "guest_os_type": "GUEST_OS", - "http_directory": "http", - "iso_checksum": "ISO_MD5", - "iso_checksum_type": "md5", - "iso_url": "ISO_URL", - "shutdown_command": "sudo shutdown -h now", - "ssh_password": "vagrant", - "ssh_port": 22, - "ssh_username": "vagrant", - "ssh_wait_timeout": "5m", - "virtualbox_version_file": ".vbox_version" - } - ], - "provisioners": [ - { - "type": "shell", - "execute_command": "sudo sh '{{.Path}}'", - "script": "scripts/postinstall.sh" - } - ], - "post-processors": [ - { - "type": "vagrant", - "output": "NIXBOX-{{.Provider}}.box" - } - ] -} - diff --git a/nixbox32-template.json b/nixbox32-template.json deleted file mode 100644 index 6cdaf2c..0000000 --- a/nixbox32-template.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "builders": [ - { - "type": "virtualbox", - "boot_wait": "1m", - "boot_command": [ - "root", - "stop sshd", - "fdisk /dev/sda", - "n", - "", - "a", - "1", - "w", - "", - "mkfs.ext4 -j -L nixos /dev/sda1", - "mount LABEL=nixos /mnt", - "nixos-generate-config --root /mnt", - "curl http://{{ .HTTPIP }}:{{ .HTTPPort }}/configuration.nix | sed -e 's|nixbox|nixbox32|g' > /mnt/etc/nixos/configuration.nix", - "nixos-install && reboot" - ], - "guest_additions_mode": "disable", - "guest_os_type": "Linux", - "http_directory": "http", - "iso_checksum": "c10f01734cb187e13068252e2cde565d", - "iso_checksum_type": "md5", - "iso_url": "http://nixos.org/releases/nixos/13.10/nixos-13.10.35455.45219b9/nixos-minimal-13.10.35455.45219b9-i686-linux.iso", - "shutdown_command": "sudo shutdown -h now", - "ssh_password": "vagrant", - "ssh_port": 22, - "ssh_username": "vagrant", - "ssh_wait_timeout": "5m", - "virtualbox_version_file": ".vbox_version" - } - ], - "provisioners": [ - { - "type": "shell", - "execute_command": "sudo sh '{{.Path}}'", - "script": "scripts/postinstall.sh" - } - ], - "post-processors": [ - { - "type": "vagrant", - "output": "nixbox32-{{.Provider}}.box" - } - ] -} -