Commit beadc88b2572

Vincent Demeester <vincent@sbr.pm>
2016-09-18 17:39:50
Add a new virtualisation file
- Add docker - Add virtualbox and vagrant
1 parent 65e9074
configuration.nix
@@ -1,7 +1,3 @@
-# Edit this configuration file to define what should be installed on
-# your system.  Help is available in the configuration.nix(5) man page
-# and in the NixOS manual (accessible by running ‘nixos-help’).
-
 { config, pkgs, ... }:
 
 {
@@ -13,6 +9,7 @@
 			./network.nix
 			./audio.nix
 			./gui.nix
+			./virtualisation.nix
 			./users.nix
 			./packages.nix
 			./local-configuration.nix
users.nix
@@ -7,7 +7,7 @@
 				isNormalUser = true;
 				uid = 1000;
 				createHome = true;
-				extraGroups = [ "networkmanager" "wheel" ];
+				extraGroups = [ "networkmanager" "wheel" "docker" "vboxusers" "input" "audio" "video" ];
 				shell = "/run/current-system/sw/bin/zsh";
 				initialPassword = "changeMe";
 			};
virtualisation.nix
@@ -0,0 +1,20 @@
+{ config, pkgs, ... }:
+
+{
+	virtualisation = {
+		docker = {
+			enable = true;
+			socketActivation = false;
+			# storageDriver = "overlay2"; # use it when docker 1.12 is here
+			storageDriver = "overlay";
+			extraOptions = "--label=type=desktop";
+		};
+		virtualbox.host.enable = true;
+	};
+	networking.firewall.trustedInterfaces = [ "docker0" "vboxnet0" ];
+	environment = {
+		systemPackages = with pkgs; [
+			vagrant
+		];
+	};
+}