nixos 64bit edition. NOT tested.
Vagrant 1.1.2 & veewee are in conflict on my system.
This commit is contained in:
parent
b26c886090
commit
ebf0631239
39
definitions/nixos64/configuration.nix
Normal file
39
definitions/nixos64/configuration.nix
Normal file
|
@ -0,0 +1,39 @@
|
|||
{ config, pkgs, ... }:
|
||||
{
|
||||
require = [ ./hardware-configuration.nix ];
|
||||
boot = {
|
||||
loader.grub.device = "/dev/sda";
|
||||
};
|
||||
environment.systemPackages = with pkgs; [ git ruby rubygems gnumake gcc ];
|
||||
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;
|
||||
};
|
||||
users = {
|
||||
extraGroups = [ { name = "vagrant"; } { name = "vboxsf"; } ];
|
||||
extraUsers = [ {
|
||||
description = "Vagrant User";
|
||||
name = "vagrant";
|
||||
group = "vagrant";
|
||||
extraGroups = [ "users" "vboxsf" "wheel" ];
|
||||
password = "vagrant";
|
||||
home = "/home/vagrant";
|
||||
createHome = true;
|
||||
useDefaultShell = true;
|
||||
openssh.authorizedKeys.keys = [
|
||||
"ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ== vagrant insecure public key"
|
||||
];
|
||||
} ];
|
||||
};
|
||||
}
|
50
definitions/nixos64/definition.rb
Normal file
50
definitions/nixos64/definition.rb
Normal file
|
@ -0,0 +1,50 @@
|
|||
iso = {
|
||||
:url => 'http://nixos.org/releases/nixos/nixos-0.2pre4587_9000fd8-cfbdb33/nixos-minimal-0.2pre4587_9000fd8-cfbdb33-x86_64-linux.iso',
|
||||
:md5 => 'f61180f387e72ee85b8f68273e5ff884',
|
||||
}
|
||||
|
||||
session = {
|
||||
:boot_cmd_sequence =>
|
||||
[
|
||||
'<Enter>', '<Wait>'*15,
|
||||
'root', '<Enter>',
|
||||
'stop sshd', '<Enter>', # Make sure we don't accept connections until reboot
|
||||
'fdisk /dev/sda', '<Enter>',
|
||||
'n', '<Enter>'*5,
|
||||
'a', '<Enter>',
|
||||
'1', '<Enter>',
|
||||
'w', '<Enter>',
|
||||
'mkfs.ext4 -j -L nixos /dev/sda1', '<Enter>',
|
||||
'mount LABEL=nixos /mnt', '<Enter>',
|
||||
'nixos-option --install', '<Enter>',
|
||||
'curl http://%IP%:%PORT%/configuration.nix > /mnt/etc/nixos/configuration.nix &&', '<Enter>',
|
||||
'nixos-install &&', '<Enter>',
|
||||
'reboot', '<Enter>',
|
||||
],
|
||||
:boot_wait => '5',
|
||||
:cpu_count => '1',
|
||||
:disk_format => 'VDI',
|
||||
:disk_size => '20400',
|
||||
:hostiocache => 'off',
|
||||
:iso_download_timeout => '1000',
|
||||
:iso_file => File.basename(iso[:url]),
|
||||
:iso_md5 => iso[:md5],
|
||||
:iso_src => iso[:url],
|
||||
:kickstart_file => 'configuration.nix',
|
||||
:kickstart_port => '7122',
|
||||
:kickstart_timeout => '10000',
|
||||
:memory_size => '256',
|
||||
:os_type_id => 'Linux26',
|
||||
:postinstall_files => [ 'postinstall.sh' ],
|
||||
:postinstall_timeout => '10000',
|
||||
:shutdown_cmd => 'shutdown -h now',
|
||||
:ssh_guest_port => '22',
|
||||
:ssh_host_port => '7222',
|
||||
:ssh_key => '',
|
||||
:ssh_login_timeout => '10000',
|
||||
:ssh_password => 'vagrant',
|
||||
:ssh_user => 'vagrant',
|
||||
:sudo_cmd => "sudo '%f'"
|
||||
}
|
||||
|
||||
Veewee::Definition.declare session
|
28
definitions/nixos64/postinstall.sh
Executable file
28
definitions/nixos64/postinstall.sh
Executable file
|
@ -0,0 +1,28 @@
|
|||
#!/bin/sh
|
||||
|
||||
# Remove VirtualBox Guest Additions ISO that the Veewee put in our
|
||||
# home dir
|
||||
|
||||
rm -f ~/*.iso
|
||||
|
||||
# Install chef & puppet
|
||||
|
||||
su - vagrant -c 'gem install chef puppet --user-install \
|
||||
--bindir=$HOME/bin --no-rdoc --no-ri'
|
||||
|
||||
# Make sure we are totally up to date
|
||||
|
||||
nixos-rebuild --upgrade switch
|
||||
|
||||
# Cleanup any previous generations and delete old packages that can be
|
||||
# pruned.
|
||||
|
||||
for x in `seq 0 2` ; do
|
||||
nix-env --delete-generations old
|
||||
nix-collect-garbage -d
|
||||
done
|
||||
|
||||
# Zero out the disk (for better compression)
|
||||
|
||||
dd if=/dev/zero of=/EMPTY bs=1M
|
||||
rm -rf /EMPTY
|
Loading…
Reference in a new issue