Still not working. It should but ssh timeout wait is indefinite

This commit is contained in:
zimbatm 2013-11-27 13:08:23 +00:00
parent 5dd24ec9fb
commit 98a66c0444
3 changed files with 107 additions and 52 deletions

View file

@ -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
'';
}

View file

@ -1,48 +1,35 @@
{
"builders": [
{
"type": "virtualbox",
"boot_wait": "1m",
"boot_command": [
"<enter><wait>",
"<wait><wait><wait><wait><wait><wait><wait><wait><wait><wait><wait><wait><wait><wait><wait><wait>",
"root<wait>",
"<enter><wait>",
"stop sshd",
"<enter><wait>",
"fdisk /dev/sda<wait>",
"<enter><wait>",
"n<wait>",
"<enter><enter><enter><enter><enter><wait>",
"a<wait>",
"<enter><wait>",
"1<wait>",
"<enter><wait>",
"w<wait>",
"<enter><wait>",
"mkfs.ext4 -j -L nixos /dev/sda1<wait>",
"<enter><wait>",
"mount LABEL=nixos /mnt<wait>",
"<enter><wait>",
"nixos-option --install<wait>",
"<enter><wait>",
"curl http://{{ .HTTPIP }}:{{ .HTTPPort }}/configuration.nix > /mnt/etc/nixos/configuration.nix &&<wait>",
"<enter><wait>",
"nixos-install &&<wait>",
"<enter><wait>",
"reboot<wait>",
"<enter><wait>"
"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>",
"nixos-install && reboot<enter>"
],
"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"
}
],

44
nixos64-template.json Normal file
View file

@ -0,0 +1,44 @@
{
"builders": [
{
"type": "virtualbox",
"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><wait><wait><wait>",
"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>",
"nixos-install && reboot<enter>"
],
"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"
}
]
}