Skip to content

Instantly share code, notes, and snippets.

@thoughtpolice
Last active August 29, 2015 13:57
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save thoughtpolice/9613522 to your computer and use it in GitHub Desktop.
Save thoughtpolice/9613522 to your computer and use it in GitHub Desktop.
NixOS configuration for Vagrant Boxes
{ config, pkgs, ... }:
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
];
boot.loader.grub.enable = true;
boot.loader.grub.version = 2;
boot.loader.grub.device = "/dev/sda";
networking.hostName = "vagrant";
services.openssh.enable = true;
services.virtualbox.enable = true;
security.sudo.enable = true;
environment.systemPackages = [ pkgs.vim pkgs.wget ];
services.openssh.extraConfig = "UseDNS no";
security.sudo.configFile = "vagrant ALL=(ALL) NOPASSWD: ALL";
security.initialRootPassword = "vagrant";
users.extraUsers.vagrant = {
description = "Vagrant User";
password = "vagrant";
home = "/home/vagrant";
createHome = true;
uid = 1001;
useDefaultShell = true;
openssh.authorizedKeys.keys =
[ "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ== vagrant insecure public key"
];
};
}
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |c|
c.vm.box = "thoughtpolice/nixos-13.10"
c.vm.provider "virtualbox" do |vb|
vb.gui = false; vb.memory = 4096; vb.cpus = 2
vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment