diff --git a/http/configuration.nix b/http/configuration.nix index 99df003..cd0ffb3 100644 --- a/http/configuration.nix +++ b/http/configuration.nix @@ -1,25 +1,37 @@ { config, pkgs, ... }: + { - require = [ ./hardware-configuration.nix ]; - boot = { - loader.grub.device = "/dev/sda"; - }; - environment.systemPackages = with pkgs; [ git gnumake gcc ruby rubygems python ]; - fileSystems = [ { mountPoint = "/"; label = "nixos"; } ]; - security.sudo.configFile = - '' - Defaults:root,%wheel env_keep+=LOCALE_ARCHIVE - Defaults:root,%wheel env_keep+=NIX_PATH - Defaults:root,%wheel env_keep+=TERMINFO_DIRS - Defaults env_keep+=SSH_AUTH_SOCK - Defaults lecture = never - root ALL=(ALL) SETENV: ALL - %wheel ALL=(ALL) NOPASSWD: ALL, SETENV: ALL - ''; - services = { - dbus.enable = true; - openssh.enable = true; - }; + imports = + [ # Include the results of the hardware scan. + ./hardware-configuration.nix + ]; + + # Use the GRUB 2 boot loader. + boot.loader.grub.enable = true; + boot.loader.grub.version = 2; + boot.loader.grub.device = "/dev/sda"; + + networking.hostName = "nixbox"; + + # Services to enable: + + # Enable the OpenSSH daemon. + services.openssh.enable = true; + + # Enable DBus + services.dbus.enable = true; + + # Default packages + environment.systemPackages = with pkgs; [ + gcc + git + gnumake + python + ruby + rubygems + ]; + + # Creates a "vagrant" users with password-less sudo access users = { extraGroups = [ { name = "vagrant"; } { name = "vboxsf"; } ]; extraUsers = [ { @@ -36,4 +48,16 @@ ]; } ]; }; + + security.sudo.configFile = + '' + Defaults:root,%wheel env_keep+=LOCALE_ARCHIVE + Defaults:root,%wheel env_keep+=NIX_PATH + Defaults:root,%wheel env_keep+=TERMINFO_DIRS + Defaults env_keep+=SSH_AUTH_SOCK + Defaults lecture = never + root ALL=(ALL) SETENV: ALL + %wheel ALL=(ALL) NOPASSWD: ALL, SETENV: ALL + ''; + } diff --git a/nixos32-template.json b/nixos32-template.json index 22668d2..ffb60d8 100644 --- a/nixos32-template.json +++ b/nixos32-template.json @@ -1,48 +1,35 @@ { "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-option --install", - "", - "curl http://{{ .HTTPIP }}:{{ .HTTPPort }}/configuration.nix > /mnt/etc/nixos/configuration.nix &&", - "", - "nixos-install &&", - "", - "reboot", - "" + "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 > /mnt/etc/nixos/configuration.nix", + "nixos-install && reboot" ], "guest_additions_mode": "disable", "guest_os_type": "Linux", "http_directory": "http", - "iso_checksum": "d0e0a64fe9a5f3f946e6f9fe0b846e70", + "iso_checksum": "c10f01734cb187e13068252e2cde565d", "iso_checksum_type": "md5", - "iso_url": "http://nixos.org/releases/nixos/13.10/nixos-13.10.35445.be4e850/nixos-minimal-13.10.35445.be4e850-x86_64-linux.iso", + "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": "10000s", - "type": "virtualbox", + "ssh_wait_timeout": "5m", "virtualbox_version_file": ".vbox_version" } ], diff --git a/nixos64-template.json b/nixos64-template.json new file mode 100644 index 0000000..929090b --- /dev/null +++ b/nixos64-template.json @@ -0,0 +1,44 @@ +{ + "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 > /mnt/etc/nixos/configuration.nix", + "nixos-install && reboot" + ], + "guest_additions_mode": "disable", + "guest_os_type": "Linux_64", + "http_directory": "http", + "iso_checksum": "fbac8c11661028e6f9c4ec293e1329e1", + "iso_checksum_type": "md5", + "iso_url": "http://nixos.org/releases/nixos/13.10/nixos-13.10.35455.45219b9/nixos-minimal-13.10.35455.45219b9-x86_64-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 '{{.Path}}'", + "script": "scripts/postinstall.sh" + } + ] +} +