Still not working. It should but ssh timeout wait is indefinite
This commit is contained in:
parent
5dd24ec9fb
commit
98a66c0444
|
@ -1,25 +1,37 @@
|
||||||
{ config, pkgs, ... }:
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
require = [ ./hardware-configuration.nix ];
|
imports =
|
||||||
boot = {
|
[ # Include the results of the hardware scan.
|
||||||
loader.grub.device = "/dev/sda";
|
./hardware-configuration.nix
|
||||||
};
|
];
|
||||||
environment.systemPackages = with pkgs; [ git gnumake gcc ruby rubygems python ];
|
|
||||||
fileSystems = [ { mountPoint = "/"; label = "nixos"; } ];
|
# Use the GRUB 2 boot loader.
|
||||||
security.sudo.configFile =
|
boot.loader.grub.enable = true;
|
||||||
''
|
boot.loader.grub.version = 2;
|
||||||
Defaults:root,%wheel env_keep+=LOCALE_ARCHIVE
|
boot.loader.grub.device = "/dev/sda";
|
||||||
Defaults:root,%wheel env_keep+=NIX_PATH
|
|
||||||
Defaults:root,%wheel env_keep+=TERMINFO_DIRS
|
networking.hostName = "nixbox";
|
||||||
Defaults env_keep+=SSH_AUTH_SOCK
|
|
||||||
Defaults lecture = never
|
# Services to enable:
|
||||||
root ALL=(ALL) SETENV: ALL
|
|
||||||
%wheel ALL=(ALL) NOPASSWD: ALL, SETENV: ALL
|
# Enable the OpenSSH daemon.
|
||||||
'';
|
services.openssh.enable = true;
|
||||||
services = {
|
|
||||||
dbus.enable = true;
|
# Enable DBus
|
||||||
openssh.enable = true;
|
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 = {
|
users = {
|
||||||
extraGroups = [ { name = "vagrant"; } { name = "vboxsf"; } ];
|
extraGroups = [ { name = "vagrant"; } { name = "vboxsf"; } ];
|
||||||
extraUsers = [ {
|
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
|
||||||
|
'';
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,48 +1,35 @@
|
||||||
{
|
{
|
||||||
"builders": [
|
"builders": [
|
||||||
{
|
{
|
||||||
|
"type": "virtualbox",
|
||||||
|
"boot_wait": "1m",
|
||||||
"boot_command": [
|
"boot_command": [
|
||||||
"<enter><wait>",
|
"root<enter>",
|
||||||
"<wait><wait><wait><wait><wait><wait><wait><wait><wait><wait><wait><wait><wait><wait><wait><wait>",
|
"stop sshd<enter>",
|
||||||
"root<wait>",
|
"fdisk /dev/sda<enter>",
|
||||||
"<enter><wait>",
|
"n",
|
||||||
"stop sshd",
|
"<enter><enter><enter><enter><enter>",
|
||||||
"<enter><wait>",
|
"a<enter>",
|
||||||
"fdisk /dev/sda<wait>",
|
"1<enter>",
|
||||||
"<enter><wait>",
|
"w<enter>",
|
||||||
"n<wait>",
|
"<wait>",
|
||||||
"<enter><enter><enter><enter><enter><wait>",
|
"mkfs.ext4 -j -L nixos /dev/sda1<enter><wait5>",
|
||||||
"a<wait>",
|
"mount LABEL=nixos /mnt<enter><wait>",
|
||||||
"<enter><wait>",
|
"nixos-generate-config --root /mnt<enter><wait>",
|
||||||
"1<wait>",
|
"curl http://{{ .HTTPIP }}:{{ .HTTPPort }}/configuration.nix > /mnt/etc/nixos/configuration.nix<enter><wait>",
|
||||||
"<enter><wait>",
|
"nixos-install && reboot<enter>"
|
||||||
"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>"
|
|
||||||
],
|
],
|
||||||
"guest_additions_mode": "disable",
|
"guest_additions_mode": "disable",
|
||||||
"guest_os_type": "Linux",
|
"guest_os_type": "Linux",
|
||||||
"http_directory": "http",
|
"http_directory": "http",
|
||||||
"iso_checksum": "d0e0a64fe9a5f3f946e6f9fe0b846e70",
|
"iso_checksum": "c10f01734cb187e13068252e2cde565d",
|
||||||
"iso_checksum_type": "md5",
|
"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",
|
"shutdown_command": "sudo shutdown -h now",
|
||||||
"ssh_password": "vagrant",
|
"ssh_password": "vagrant",
|
||||||
"ssh_port": 22,
|
"ssh_port": 22,
|
||||||
"ssh_username": "vagrant",
|
"ssh_username": "vagrant",
|
||||||
"ssh_wait_timeout": "10000s",
|
"ssh_wait_timeout": "5m",
|
||||||
"type": "virtualbox",
|
|
||||||
"virtualbox_version_file": ".vbox_version"
|
"virtualbox_version_file": ".vbox_version"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
44
nixos64-template.json
Normal file
44
nixos64-template.json
Normal 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"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue