summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/hardware/video/bumblebee.nix35
-rw-r--r--nixos/modules/services/hardware/tlp.nix5
-rw-r--r--nixos/modules/services/misc/gitlab.nix27
-rw-r--r--nixos/modules/services/misc/nixos-manual.nix2
-rw-r--r--nixos/modules/services/monitoring/teamviewer.nix6
-rw-r--r--nixos/modules/services/networking/nsd.nix34
-rw-r--r--nixos/modules/services/web-servers/apache-httpd/owncloud.nix46
-rw-r--r--nixos/modules/services/x11/window-managers/afterstep.nix5
-rw-r--r--nixos/modules/services/x11/window-managers/bspwm.nix7
-rw-r--r--nixos/modules/services/x11/window-managers/clfswm.nix9
-rw-r--r--nixos/modules/services/x11/window-managers/compiz.nix5
-rw-r--r--nixos/modules/services/x11/window-managers/fluxbox.nix5
-rw-r--r--nixos/modules/services/x11/window-managers/herbstluftwm.nix7
-rw-r--r--nixos/modules/services/x11/window-managers/i3.nix6
-rw-r--r--nixos/modules/services/x11/window-managers/icewm.nix2
-rw-r--r--nixos/modules/services/x11/window-managers/metacity.nix8
-rw-r--r--nixos/modules/services/x11/window-managers/notion.nix8
-rw-r--r--nixos/modules/services/x11/window-managers/openbox.nix9
-rw-r--r--nixos/modules/services/x11/window-managers/ratpoison.nix5
-rw-r--r--nixos/modules/services/x11/window-managers/sawfish.nix5
-rw-r--r--nixos/modules/services/x11/window-managers/spectrwm.nix8
-rw-r--r--nixos/modules/services/x11/window-managers/stumpwm.nix9
-rw-r--r--nixos/modules/services/x11/window-managers/twm.nix7
-rw-r--r--nixos/modules/services/x11/window-managers/windowmaker.nix5
-rw-r--r--nixos/modules/services/x11/window-managers/wmii.nix9
-rw-r--r--nixos/modules/services/x11/window-managers/xmonad.nix8
-rw-r--r--nixos/modules/tasks/kbd.nix2
-rw-r--r--nixos/modules/virtualisation/nova-image.nix1
28 files changed, 118 insertions, 167 deletions
diff --git a/nixos/modules/hardware/video/bumblebee.nix b/nixos/modules/hardware/video/bumblebee.nix
index e2202e1e17df..b10846ac18a1 100644
--- a/nixos/modules/hardware/video/bumblebee.nix
+++ b/nixos/modules/hardware/video/bumblebee.nix
@@ -2,10 +2,20 @@
 
 with lib;
 let
+  cfg = config.hardware.bumblebee;
+
   kernel = config.boot.kernelPackages;
-  bumblebee = if config.hardware.bumblebee.connectDisplay
-              then pkgs.bumblebee_display
-              else pkgs.bumblebee;
+
+  useNvidia = cfg.driver == "nvidia";
+
+  bumblebee = pkgs.bumblebee.override {
+    inherit useNvidia;
+    useDisplayDevice = cfg.connectDisplay;
+  };
+
+  primus = pkgs.primus.override {
+    inherit useNvidia;
+  };
 
 in
 
@@ -29,6 +39,7 @@ in
       type = types.str;
       description = ''Group for bumblebee socket'';
     };
+
     hardware.bumblebee.connectDisplay = mkOption {
       default = false;
       type = types.bool;
@@ -40,26 +51,30 @@ in
         Only nvidia driver is supported so far.
       '';
     };
+
+    hardware.bumblebee.driver = mkOption {
+      default = "nvidia";
+      type = types.enum [ "nvidia" "nouveau" ];
+      description = ''
+        Set driver used by bumblebeed. Supported are nouveau and nvidia.
+      '';
+    };
   };
 
   config = mkIf config.hardware.bumblebee.enable {
     boot.blacklistedKernelModules = [ "nouveau" "nvidia" ];
     boot.kernelModules = [ "bbswitch" ];
-    boot.extraModulePackages = [ kernel.bbswitch kernel.nvidia_x11 ];
+    boot.extraModulePackages = [ kernel.bbswitch ] ++ optional useNvidia kernel.nvidia_x11;
 
-    environment.systemPackages = [ bumblebee pkgs.primus ];
+    environment.systemPackages = [ bumblebee primus ];
 
     systemd.services.bumblebeed = {
       description = "Bumblebee Hybrid Graphics Switcher";
       wantedBy = [ "display-manager.service" ];
       path = [ kernel.bbswitch bumblebee ];
       serviceConfig = {
-        ExecStart = "${bumblebee}/bin/bumblebeed --use-syslog -g ${config.hardware.bumblebee.group}";
-        Restart = "always";
-        RestartSec = 60;
-        CPUSchedulingPolicy = "idle";
+        ExecStart = "${bumblebee}/bin/bumblebeed --use-syslog -g ${cfg.group} --driver ${cfg.driver}";
       };
-      environment.LD_LIBRARY_PATH="/run/opengl-driver/lib/";
       environment.MODULE_DIR="/run/current-system/kernel-modules/lib/modules/";
     };
   };
diff --git a/nixos/modules/services/hardware/tlp.nix b/nixos/modules/services/hardware/tlp.nix
index 23b6edcefd1a..6427c5be6818 100644
--- a/nixos/modules/services/hardware/tlp.nix
+++ b/nixos/modules/services/hardware/tlp.nix
@@ -10,7 +10,6 @@ enableRDW = config.networking.networkmanager.enable;
 
 tlp = pkgs.tlp.override {
   inherit enableRDW;
-  kmod = config.system.sbin.modprobe;
 };
 
 # XXX: We can't use writeTextFile + readFile here because it triggers
@@ -69,6 +68,8 @@ in
           ExecStart = "${tlp}/bin/tlp init start";
           ExecStop = "${tlp}/bin/tlp init stop";
         };
+
+        environment.MODULE_DIR="/run/current-system/kernel-modules/lib/modules/";
       };
 
       tlp-sleep = {
@@ -87,6 +88,8 @@ in
           ExecStart = "${tlp}/bin/tlp suspend";
           ExecStop = "${tlp}/bin/tlp resume";
         };
+
+        environment.MODULE_DIR="/run/current-system/kernel-modules/lib/modules/";
       };
     };
 
diff --git a/nixos/modules/services/misc/gitlab.nix b/nixos/modules/services/misc/gitlab.nix
index 4505c5ceb84f..949357ab20f4 100644
--- a/nixos/modules/services/misc/gitlab.nix
+++ b/nixos/modules/services/misc/gitlab.nix
@@ -27,6 +27,7 @@ let
     http_settings:
       self_signed_cert: false
     repos_path: "${cfg.stateDir}/repositories"
+    secret_file: "${cfg.stateDir}/config/gitlab_shell_secret"
     log_file: "${cfg.stateDir}/log/gitlab-shell.log"
     redis:
       bin: ${pkgs.redis}/bin/redis-cli
@@ -142,7 +143,7 @@ in {
 
   config = mkIf cfg.enable {
 
-    environment.systemPackages = [ gitlab-runner pkgs.gitlab-shell ];
+    environment.systemPackages = [ pkgs.git gitlab-runner pkgs.gitlab-shell ];
 
     assertions = [
       { assertion = cfg.databasePassword != "";
@@ -154,7 +155,6 @@ in {
     services.redis.enable = mkDefault true;
     # We use postgres as the main data store.
     services.postgresql.enable = mkDefault true;
-    services.postgresql.package = mkDefault pkgs.postgresql;
     # Use postfix to send out mails.
     services.postfix.enable = mkDefault true;
 
@@ -209,6 +209,23 @@ in {
       };
     };
 
+    systemd.services.gitlab-git-http-server = {
+      after = [ "network.target" "gitlab.service" ];
+      wantedBy = [ "multi-user.target" ];
+      environment.HOME = "${cfg.stateDir}/home";
+      path = with pkgs; [
+        gitAndTools.git
+        openssh
+      ];
+      serviceConfig = {
+        Type = "simple";
+        User = "gitlab";
+        Group = "gitlab";
+        TimeoutSec = "300";
+        ExecStart = "${pkgs.gitlab-git-http-server}/bin/gitlab-git-http-server -listenUmask 0 -listenNetwork unix -listenAddr ${cfg.stateDir}/tmp/sockets/gitlab-git-http-server.socket -authBackend http://localhost:8080 ${cfg.stateDir}/repositories";
+      };
+    };
+
     systemd.services.gitlab = {
       after = [ "network.target" "postgresql.service" "redis.service" ];
       wantedBy = [ "multi-user.target" ];
@@ -219,6 +236,8 @@ in {
       environment.GITLAB_APPLICATION_LOG_PATH = "${cfg.stateDir}/log/application.log";
       environment.GITLAB_SATELLITES_PATH = "${cfg.stateDir}/satellites";
       environment.GITLAB_SHELL_PATH = "${pkgs.gitlab-shell}";
+      environment.GITLAB_SHELL_CONFIG_PATH = "${cfg.stateDir}/shell/config.yml";
+      environment.GITLAB_SHELL_SECRET_PATH = "${cfg.stateDir}/config/gitlab_shell_secret";
       environment.GITLAB_REPOSITORIES_PATH = "${cfg.stateDir}/repositories";
       environment.GITLAB_SHELL_HOOKS_PATH = "${cfg.stateDir}/shell/hooks";
       environment.BUNDLE_GEMFILE = "${pkgs.gitlab}/share/gitlab/Gemfile";
@@ -247,7 +266,7 @@ in {
         rm -rf ${cfg.stateDir}/config
         mkdir -p ${cfg.stateDir}/config
         # TODO: What exactly is gitlab-shell doing with the secret?
-        head -c 20 /dev/urandom > ${cfg.stateDir}/config/gitlab_shell_secret
+        tr -dc _A-Z-a-z-0-9 < /dev/urandom | head -c 20 > ${cfg.stateDir}/config/gitlab_shell_secret
         mkdir -p ${cfg.stateDir}/home/.ssh
         touch ${cfg.stateDir}/home/.ssh/authorized_keys
 
@@ -272,6 +291,7 @@ in {
           fi
         fi
 
+      ${bundler}/bin/bundle exec rake -f ${pkgs.gitlab}/share/gitlab/Rakefile db:migrate RAILS_ENV=production
       # Install the shell required to push repositories
       ln -fs ${pkgs.writeText "config.yml" gitlabShellYml} ${cfg.stateDir}/shell/config.yml
       export GITLAB_SHELL_CONFIG_PATH=""${cfg.stateDir}/shell/config.yml
@@ -296,5 +316,4 @@ in {
     };
 
   };
-
 }
diff --git a/nixos/modules/services/misc/nixos-manual.nix b/nixos/modules/services/misc/nixos-manual.nix
index 7534eb0ae6a3..3e1f53e79f3e 100644
--- a/nixos/modules/services/misc/nixos-manual.nix
+++ b/nixos/modules/services/misc/nixos-manual.nix
@@ -117,7 +117,7 @@ in
     services.mingetty.helpLine = mkIf cfg.showManual
       "\nPress <Alt-F${toString cfg.ttyNumber}> for the NixOS manual.";
 
-    services.nixosManual.browser = mkDefault "${pkgs.w3m}/bin/w3m";
+    services.nixosManual.browser = mkDefault "${pkgs.w3m-nox}/bin/w3m";
 
   };
 
diff --git a/nixos/modules/services/monitoring/teamviewer.nix b/nixos/modules/services/monitoring/teamviewer.nix
index 533f1ea6644b..dd98ecab828d 100644
--- a/nixos/modules/services/monitoring/teamviewer.nix
+++ b/nixos/modules/services/monitoring/teamviewer.nix
@@ -14,7 +14,7 @@ in
 
   options = {
 
-    services.teamviewer.enable = mkEnableOption "teamviewer daemon";
+    services.teamviewer.enable = mkEnableOption "TeamViewer daemon";
       
   };
 
@@ -27,9 +27,9 @@ in
     systemd.services.teamviewerd = {
       description = "TeamViewer remote control daemon";
 
-      wantedBy = [ "graphical.target" ];
+      wantedBy = [ "multi-user.target" ];
       after = [ "NetworkManager-wait-online.service" "network.target" ];
-      preStart = "mkdir -pv /var/tmp/teamviewer10/{logs,config}";
+      preStart = "mkdir -pv /var/lib/teamviewer /var/log/teamviewer";
 
       serviceConfig = {
         Type = "forking";
diff --git a/nixos/modules/services/networking/nsd.nix b/nixos/modules/services/networking/nsd.nix
index 36d9f5d2f166..e85f26811257 100644
--- a/nixos/modules/services/networking/nsd.nix
+++ b/nixos/modules/services/networking/nsd.nix
@@ -300,22 +300,8 @@ in
   options = {
     services.nsd = {
 
-      enable = mkOption {
-        type        = types.bool;
-        default     = false;
-        description = ''
-          Whether to enable the NSD authoritative domain name server.
-        '';
-      };
-
-      bind8Stats = mkOption {
-        type        = types.bool;
-        default     = false;
-        example     = true;
-        description = ''
-          Wheter to enable BIND8 like statisics.
-        '';
-      };
+      enable = mkEnableOption "NSD authoritative DNS server";
+      bind8Stats = mkEnableOption "BIND8 like statistics";
 
       rootServer = mkOption {
         type        = types.bool;
@@ -483,13 +469,7 @@ in
 
 
       ratelimit = {
-        enable = mkOption {
-          type        = types.bool;
-          default     = false;
-          description = ''
-            Enable ratelimit capabilities.
-          '';
-        };
+        enable = mkEnableOption "ratelimit capabilities";
 
         size = mkOption {
           type        = types.int;
@@ -548,13 +528,7 @@ in
 
 
       remoteControl = {
-        enable = mkOption {
-          type        = types.bool;
-          default     = false;
-          description = ''
-            Wheter to enable remote control via nsd-control(8).
-          '';
-        };
+        enable = mkEnableOption "remote control via nsd-control";
 
         interfaces = mkOption {
           type        = types.listOf types.str;
diff --git a/nixos/modules/services/web-servers/apache-httpd/owncloud.nix b/nixos/modules/services/web-servers/apache-httpd/owncloud.nix
index a5e539bc9ba7..9994de0f9b40 100644
--- a/nixos/modules/services/web-servers/apache-httpd/owncloud.nix
+++ b/nixos/modules/services/web-servers/apache-httpd/owncloud.nix
@@ -70,7 +70,7 @@ let
       "proxyuserpwd" => "",
 
       /* List of trusted domains, to prevent host header poisoning ownCloud is only using these Host headers */
-      'trusted_domains' => array('${config.trustedDomain}'),
+      ${if config.trustedDomain != "" then "'trusted_domains' => array('${config.trustedDomain}')," else ""}
 
       /* Theme to use for ownCloud */
       "theme" => "",
@@ -331,7 +331,7 @@ let
        */
       'share_folder' => '/',
 
-      'version' => '${pkgs.owncloud.version}',
+      'version' => '${config.package.version}',
 
       'openssl' => '${pkgs.openssl}/bin/openssl'
 
@@ -345,16 +345,15 @@ rec {
 
   extraConfig =
     ''
-      ServerName ${config.siteName}
-      ServerAdmin ${config.adminAddr}
-      DocumentRoot ${documentRoot}
+      ${if config.urlPrefix != "" then "Alias ${config.urlPrefix} ${config.package}" else ''
 
-      RewriteEngine On
-      RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
-      RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d
+        RewriteEngine On
+        RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
+        RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d
+      ''}
 
-      <Directory ${pkgs.owncloud}>
-        ${builtins.readFile "${pkgs.owncloud}/.htaccess"}
+      <Directory ${config.package}>
+        ${builtins.readFile "${config.package}/.htaccess"}
       </Directory>
     '';
 
@@ -362,12 +361,29 @@ rec {
     { name = "OC_CONFIG_PATH"; value = "${config.dataDir}/config/"; }
   ];
 
-  documentRoot = pkgs.owncloud;
+  documentRoot = if config.urlPrefix == "" then config.package else null;
 
   enablePHP = true;
 
   options = {
 
+    package = mkOption {
+      type = types.package;
+      default = pkgs.owncloud70;
+      example = literalExample "pkgs.owncloud70";
+      description = ''
+          PostgreSQL package to use.
+      '';
+    };
+
+    urlPrefix = mkOption {
+      default = "";
+      example = "/owncloud";
+      description = ''
+        The URL prefix under which the owncloud service appears.
+      '';
+    };
+
     id = mkOption {
       default = "main";
       description = ''
@@ -552,7 +568,7 @@ rec {
       cp ${owncloudConfig} ${config.dataDir}/config/config.php
       mkdir -p ${config.dataDir}/storage
       mkdir -p ${config.dataDir}/apps
-      cp -r ${pkgs.owncloud}/apps/* ${config.dataDir}/apps/
+      cp -r ${config.package}/apps/* ${config.dataDir}/apps/
       chmod -R ug+rw ${config.dataDir}
       chmod -R o-rwx ${config.dataDir}
       chown -R wwwrun:wwwrun ${config.dataDir}
@@ -566,7 +582,11 @@ rec {
       ${pkgs.sudo}/bin/sudo -u postgres ${pkgs.postgresql}/bin/psql -h "/tmp" -U postgres -d ${config.dbName} -Atw -c "$QUERY" || true
     fi
 
-    ${php}/bin/php ${pkgs.owncloud}/occ upgrade || true
+    if [ -e ${config.package}/config/ca-bundle.crt ]; then
+      cp -f ${config.package}/config/ca-bundle.crt ${config.dataDir}/config/
+    fi
+
+    ${php}/bin/php ${config.package}/occ upgrade >> ${config.dataDir}/upgrade.log || true
 
     chown wwwrun:wwwrun ${config.dataDir}/owncloud.log || true
 
diff --git a/nixos/modules/services/x11/window-managers/afterstep.nix b/nixos/modules/services/x11/window-managers/afterstep.nix
index 395dabb86b5e..ba88a64c702a 100644
--- a/nixos/modules/services/x11/window-managers/afterstep.nix
+++ b/nixos/modules/services/x11/window-managers/afterstep.nix
@@ -8,10 +8,7 @@ in
 {
   ###### interface
   options = {
-    services.xserver.windowManager.afterstep.enable = mkOption {
-      default = false;
-      description = "Enable the Afterstep window manager.";
-    };
+    services.xserver.windowManager.afterstep.enable = mkEnableOption "afterstep";
   };
 
   ###### implementation
diff --git a/nixos/modules/services/x11/window-managers/bspwm.nix b/nixos/modules/services/x11/window-managers/bspwm.nix
index d234a432e9a9..8b4e91d25aa4 100644
--- a/nixos/modules/services/x11/window-managers/bspwm.nix
+++ b/nixos/modules/services/x11/window-managers/bspwm.nix
@@ -8,12 +8,7 @@ in
 
 {
   options = {
-    services.xserver.windowManager.bspwm.enable = mkOption {
-      type = types.bool;
-      default = false;
-      example = true;
-      description = "Enable the bspwm window manager.";
-    };
+    services.xserver.windowManager.bspwm.enable = mkEnableOption "bspwm";
   };
 
   config = mkIf cfg.enable {
diff --git a/nixos/modules/services/x11/window-managers/clfswm.nix b/nixos/modules/services/x11/window-managers/clfswm.nix
index 9d8eecb56c77..176c1f461271 100644
--- a/nixos/modules/services/x11/window-managers/clfswm.nix
+++ b/nixos/modules/services/x11/window-managers/clfswm.nix
@@ -8,14 +8,7 @@ in
 
 {
   options = {
-    services.xserver.windowManager.clfswm = {
-      enable = mkOption {
-        type = types.bool;
-        default = false;
-        example = true;
-        description = "Enable the clfswm tiling window manager.";
-      };
-    };
+    services.xserver.windowManager.clfswm.enable = mkEnableOption "clfswm";
   };
 
   config = mkIf cfg.enable {
diff --git a/nixos/modules/services/x11/window-managers/compiz.nix b/nixos/modules/services/x11/window-managers/compiz.nix
index ffd71e5f91ec..539a83f99068 100644
--- a/nixos/modules/services/x11/window-managers/compiz.nix
+++ b/nixos/modules/services/x11/window-managers/compiz.nix
@@ -15,10 +15,7 @@ in
 
     services.xserver.windowManager.compiz = {
 
-      enable = mkOption {
-        default = false;
-        description = "Enable the Compiz window manager.";
-      };
+      enable = mkEnableOption "compiz";
 
       renderingFlag = mkOption {
         default = "";
diff --git a/nixos/modules/services/x11/window-managers/fluxbox.nix b/nixos/modules/services/x11/window-managers/fluxbox.nix
index 4748ce99ccf2..b409335702af 100644
--- a/nixos/modules/services/x11/window-managers/fluxbox.nix
+++ b/nixos/modules/services/x11/window-managers/fluxbox.nix
@@ -8,10 +8,7 @@ in
 {
   ###### interface
   options = {
-    services.xserver.windowManager.fluxbox.enable = mkOption {
-      default = false;
-      description = "Enable the Fluxbox window manager.";
-    };
+    services.xserver.windowManager.fluxbox.enable = mkEnableOption "fluxbox";
   };
 
   ###### implementation
diff --git a/nixos/modules/services/x11/window-managers/herbstluftwm.nix b/nixos/modules/services/x11/window-managers/herbstluftwm.nix
index 6cda910b6b33..829935fa432b 100644
--- a/nixos/modules/services/x11/window-managers/herbstluftwm.nix
+++ b/nixos/modules/services/x11/window-managers/herbstluftwm.nix
@@ -8,12 +8,7 @@ in
 
 {
   options = {
-    services.xserver.windowManager.herbstluftwm.enable = mkOption {
-      type = types.bool;
-      default = false;
-      example = true;
-      description = "Enable the herbstluftwm window manager.";
-    };
+    services.xserver.windowManager.herbstluftwm.enable = mkEnableOption "herbstluftwm";
   };
 
   config = mkIf cfg.enable {
diff --git a/nixos/modules/services/x11/window-managers/i3.nix b/nixos/modules/services/x11/window-managers/i3.nix
index e85c3bce591d..0d5816e363d6 100644
--- a/nixos/modules/services/x11/window-managers/i3.nix
+++ b/nixos/modules/services/x11/window-managers/i3.nix
@@ -9,11 +9,7 @@ in
 {
   options = {
     services.xserver.windowManager.i3 = {
-      enable = mkOption {
-        default = false;
-        example = true;
-        description = "Enable the i3 tiling window manager.";
-      };
+      enable = mkEnableOption "i3";
 
       configFile = mkOption {
         default = null;
diff --git a/nixos/modules/services/x11/window-managers/icewm.nix b/nixos/modules/services/x11/window-managers/icewm.nix
index 9a3e80221890..f4ae9222df67 100644
--- a/nixos/modules/services/x11/window-managers/icewm.nix
+++ b/nixos/modules/services/x11/window-managers/icewm.nix
@@ -8,7 +8,7 @@ in
 {
   ###### interface
   options = {
-    services.xserver.windowManager.icewm.enable = mkEnableOption "oroborus";
+    services.xserver.windowManager.icewm.enable = mkEnableOption "icewm";
   };
 
   ###### implementation
diff --git a/nixos/modules/services/x11/window-managers/metacity.nix b/nixos/modules/services/x11/window-managers/metacity.nix
index d13cbcfe40e8..3e5229be634f 100644
--- a/nixos/modules/services/x11/window-managers/metacity.nix
+++ b/nixos/modules/services/x11/window-managers/metacity.nix
@@ -12,13 +12,7 @@ in
 
 {
   options = {
-
-    services.xserver.windowManager.metacity.enable = mkOption {
-      default = false;
-      example = true;
-      description = "Enable the metacity window manager.";
-    };
-
+    services.xserver.windowManager.metacity.enable = mkEnableOption "metacity";
   };
 
   config = mkIf cfg.enable {
diff --git a/nixos/modules/services/x11/window-managers/notion.nix b/nixos/modules/services/x11/window-managers/notion.nix
index 1bfc2a86e965..4ece0d241c90 100644
--- a/nixos/modules/services/x11/window-managers/notion.nix
+++ b/nixos/modules/services/x11/window-managers/notion.nix
@@ -8,13 +8,7 @@ in
 
 {
   options = {
-    services.xserver.windowManager.notion = {
-      enable = mkOption {
-        default = false;
-        example = true;
-        description = "Enable the notion tiling window manager.";
-      };
-    };
+    services.xserver.windowManager.notion.enable = mkEnableOption "notion";
   };
 
   config = mkIf cfg.enable {
diff --git a/nixos/modules/services/x11/window-managers/openbox.nix b/nixos/modules/services/x11/window-managers/openbox.nix
index 8fc759dda68a..091b533b28be 100644
--- a/nixos/modules/services/x11/window-managers/openbox.nix
+++ b/nixos/modules/services/x11/window-managers/openbox.nix
@@ -1,5 +1,6 @@
 {lib, pkgs, config, ...}:
 
+with lib;
 let
   inherit (lib) mkOption mkIf;
   cfg = config.services.xserver.windowManager.openbox;
@@ -7,13 +8,7 @@ in
 
 {
   options = {
-    services.xserver.windowManager.openbox = {
-      enable = mkOption {
-        default = false;
-        example = true;
-        description = "Enable the Openbox window manager.";
-      };
-    };
+    services.xserver.windowManager.openbox.enable = mkEnableOption "oroborus";
   };
 
   config = mkIf cfg.enable {
diff --git a/nixos/modules/services/x11/window-managers/ratpoison.nix b/nixos/modules/services/x11/window-managers/ratpoison.nix
index c203c35cd1b7..0d58481d4579 100644
--- a/nixos/modules/services/x11/window-managers/ratpoison.nix
+++ b/nixos/modules/services/x11/window-managers/ratpoison.nix
@@ -8,10 +8,7 @@ in
 {
   ###### interface
   options = {
-    services.xserver.windowManager.ratpoison.enable = mkOption {
-      default = false;
-      description = "Enable the Ratpoison window manager.";
-    };
+    services.xserver.windowManager.ratpoison.enable = mkEnableOption "ratpoison";
   };
 
   ###### implementation
diff --git a/nixos/modules/services/x11/window-managers/sawfish.nix b/nixos/modules/services/x11/window-managers/sawfish.nix
index 74a119260208..b988b5e1829e 100644
--- a/nixos/modules/services/x11/window-managers/sawfish.nix
+++ b/nixos/modules/services/x11/window-managers/sawfish.nix
@@ -8,10 +8,7 @@ in
 {
   ###### interface
   options = {
-    services.xserver.windowManager.sawfish.enable = mkOption {
-      default = false;
-      description = "Enable the Sawfish window manager.";
-    };
+    services.xserver.windowManager.sawfish.enable = mkEnableOption "sawfish";
   };
 
   ###### implementation
diff --git a/nixos/modules/services/x11/window-managers/spectrwm.nix b/nixos/modules/services/x11/window-managers/spectrwm.nix
index 5db6b41ba8fd..a1dc298d2426 100644
--- a/nixos/modules/services/x11/window-managers/spectrwm.nix
+++ b/nixos/modules/services/x11/window-managers/spectrwm.nix
@@ -9,13 +9,7 @@ in
 
 {
   options = {
-    services.xserver.windowManager.spectrwm = {
-      enable = mkOption {
-        default = false;
-        example = true;
-        description = "Enable the spectrwm window manager.";
-      };
-    };
+    services.xserver.windowManager.spectrwm.enable = mkEnableOption "spectrwm";
   };
 
   config = mkIf cfg.enable {
diff --git a/nixos/modules/services/x11/window-managers/stumpwm.nix b/nixos/modules/services/x11/window-managers/stumpwm.nix
index eb7b8665f23c..3d3f2e0028c0 100644
--- a/nixos/modules/services/x11/window-managers/stumpwm.nix
+++ b/nixos/modules/services/x11/window-managers/stumpwm.nix
@@ -8,14 +8,7 @@ in
 
 {
   options = {
-    services.xserver.windowManager.stumpwm = {
-      enable = mkOption {
-        type = types.bool;
-        default = false;
-        example = true;
-        description = "Enable the stumpwm tiling window manager.";
-      };
-    };
+    services.xserver.windowManager.stumpwm.enable = mkEnableOption "stumpwm";
   };
 
   config = mkIf cfg.enable {
diff --git a/nixos/modules/services/x11/window-managers/twm.nix b/nixos/modules/services/x11/window-managers/twm.nix
index 684b34c2f246..fc09901aae3b 100644
--- a/nixos/modules/services/x11/window-managers/twm.nix
+++ b/nixos/modules/services/x11/window-managers/twm.nix
@@ -13,12 +13,7 @@ in
   ###### interface
 
   options = {
-
-    services.xserver.windowManager.twm.enable = mkOption {
-      default = false;
-      description = "Enable the twm window manager.";
-    };
-
+    services.xserver.windowManager.twm.enable = mkEnableOption "twm";
   };
 
 
diff --git a/nixos/modules/services/x11/window-managers/windowmaker.nix b/nixos/modules/services/x11/window-managers/windowmaker.nix
index 27cedb7da0ca..b62723758056 100644
--- a/nixos/modules/services/x11/window-managers/windowmaker.nix
+++ b/nixos/modules/services/x11/window-managers/windowmaker.nix
@@ -8,10 +8,7 @@ in
 {
   ###### interface
   options = {
-    services.xserver.windowManager.windowmaker.enable = mkOption {
-      default = false;
-      description = "Enable the Windowmaker window manager.";
-    };
+    services.xserver.windowManager.windowmaker.enable = mkEnableOption "windowmaker";
   };
 
   ###### implementation
diff --git a/nixos/modules/services/x11/window-managers/wmii.nix b/nixos/modules/services/x11/window-managers/wmii.nix
index e6f534a1be66..30c8df782245 100644
--- a/nixos/modules/services/x11/window-managers/wmii.nix
+++ b/nixos/modules/services/x11/window-managers/wmii.nix
@@ -1,5 +1,6 @@
-{ config, lib, pkgs, options, modulesPath }:
+{ config, lib, pkgs, options, modulesPath, ... }:
 
+with lib;
 let
   inherit (lib) mkOption mkIf singleton;
   cfg = config.services.xserver.windowManager.wmii;
@@ -7,11 +8,7 @@ let
 in
 {
   options = {
-    services.xserver.windowManager.wmii.enable = mkOption {
-      default = false;
-      example = true;
-      description = "Enable the wmii window manager.";
-    };
+    services.xserver.windowManager.wmii.enable = mkEnableOption "wmii";
   };
 
   config = mkIf cfg.enable {
diff --git a/nixos/modules/services/x11/window-managers/xmonad.nix b/nixos/modules/services/x11/window-managers/xmonad.nix
index 288800d514d3..6af88d4f645b 100644
--- a/nixos/modules/services/x11/window-managers/xmonad.nix
+++ b/nixos/modules/services/x11/window-managers/xmonad.nix
@@ -1,5 +1,6 @@
 {pkgs, lib, config, ...}:
 
+with lib;
 let
   inherit (lib) mkOption mkIf optionals literalExample;
   cfg = config.services.xserver.windowManager.xmonad;
@@ -13,12 +14,7 @@ in
 {
   options = {
     services.xserver.windowManager.xmonad = {
-      enable = mkOption {
-        default = false;
-        example = true;
-        description = "Enable the xmonad window manager.";
-      };
-
+      enable = mkEnableOption "xmonad";
       haskellPackages = mkOption {
         default = pkgs.haskellPackages;
         defaultText = "pkgs.haskellPackages";
diff --git a/nixos/modules/tasks/kbd.nix b/nixos/modules/tasks/kbd.nix
index 5969da7062b6..e36e9f85f1e3 100644
--- a/nixos/modules/tasks/kbd.nix
+++ b/nixos/modules/tasks/kbd.nix
@@ -56,6 +56,8 @@ in
     # it has a restart trigger.
     systemd.services."systemd-vconsole-setup" =
       { wantedBy = [ "multi-user.target" ];
+        before = [ "display-manager.service" ];
+        after = [ "systemd-udev-settle.service" ];
         restartTriggers = [ vconsoleConf ];
       };
 
diff --git a/nixos/modules/virtualisation/nova-image.nix b/nixos/modules/virtualisation/nova-image.nix
index 44c83aee2732..13e36e7888b5 100644
--- a/nixos/modules/virtualisation/nova-image.nix
+++ b/nixos/modules/virtualisation/nova-image.nix
@@ -21,7 +21,6 @@ with lib;
   imports = [
     ../profiles/qemu-guest.nix
     ../profiles/headless.nix
-    ./ec2-data.nix
   ];
 
   fileSystems."/".device = "/dev/disk/by-label/nixos";