summary refs log tree commit diff
path: root/nixos/modules/services/x11
diff options
context:
space:
mode:
authorVladimír Čunát <vcunat@gmail.com>2015-11-20 14:32:58 +0100
committerVladimír Čunát <vcunat@gmail.com>2015-11-20 14:32:58 +0100
commit333d69a5f0e7ccfe7b8c0bdb14ebd3934b3f77fb (patch)
tree0f4757ddd2bb3d73b438eea85828d8e01c049583 /nixos/modules/services/x11
parentbdbbfa0d4247e203ffe3171621b614374da05f70 (diff)
parentb809f886c0bdbd4665fc65a4c308d38a30c368d8 (diff)
downloadnixlib-333d69a5f0e7ccfe7b8c0bdb14ebd3934b3f77fb.tar
nixlib-333d69a5f0e7ccfe7b8c0bdb14ebd3934b3f77fb.tar.gz
nixlib-333d69a5f0e7ccfe7b8c0bdb14ebd3934b3f77fb.tar.bz2
nixlib-333d69a5f0e7ccfe7b8c0bdb14ebd3934b3f77fb.tar.lz
nixlib-333d69a5f0e7ccfe7b8c0bdb14ebd3934b3f77fb.tar.xz
nixlib-333d69a5f0e7ccfe7b8c0bdb14ebd3934b3f77fb.tar.zst
nixlib-333d69a5f0e7ccfe7b8c0bdb14ebd3934b3f77fb.zip
Merge staging into closure-size
The most complex problems were from dealing with switches reverted in
the meantime (gcc5, gmp6, ncurses6).
It's likely that darwin is (still) broken nontrivially.
Diffstat (limited to 'nixos/modules/services/x11')
-rw-r--r--nixos/modules/services/x11/desktop-managers/gnome3.nix1
-rw-r--r--nixos/modules/services/x11/desktop-managers/kde5.nix135
-rw-r--r--nixos/modules/services/x11/display-managers/gdm.nix4
-rw-r--r--nixos/modules/services/x11/display-managers/sddm.nix90
-rw-r--r--nixos/modules/services/x11/redshift.nix12
-rw-r--r--nixos/modules/services/x11/window-managers/clfswm.nix31
-rw-r--r--nixos/modules/services/x11/window-managers/default.nix1
-rw-r--r--nixos/modules/services/x11/window-managers/xmonad.nix6
8 files changed, 222 insertions, 58 deletions
diff --git a/nixos/modules/services/x11/desktop-managers/gnome3.nix b/nixos/modules/services/x11/desktop-managers/gnome3.nix
index 0fc255c4d64c..e32d6669b046 100644
--- a/nixos/modules/services/x11/desktop-managers/gnome3.nix
+++ b/nixos/modules/services/x11/desktop-managers/gnome3.nix
@@ -104,6 +104,7 @@ in {
 
     services.xserver.desktopManager.session = singleton
       { name = "gnome3";
+        bgSupport = true;
         start = ''
           # Set GTK_DATA_PREFIX so that GTK+ can find the themes
           export GTK_DATA_PREFIX=${config.system.path}
diff --git a/nixos/modules/services/x11/desktop-managers/kde5.nix b/nixos/modules/services/x11/desktop-managers/kde5.nix
index 5061d59b7c7f..6fdd5b4fa36d 100644
--- a/nixos/modules/services/x11/desktop-managers/kde5.nix
+++ b/nixos/modules/services/x11/desktop-managers/kde5.nix
@@ -8,38 +8,9 @@ let
   cfg = xcfg.desktopManager.kde5;
   xorg = pkgs.xorg;
 
-  phononBackends = {
-    gstreamer = [
-      pkgs.phonon_backend_gstreamer
-      pkgs.gst_all.gstreamer
-      pkgs.gst_all.gstPluginsBase
-      pkgs.gst_all.gstPluginsGood
-      pkgs.gst_all.gstPluginsUgly
-      pkgs.gst_all.gstPluginsBad
-      pkgs.gst_all.gstFfmpeg # for mp3 playback
-      pkgs.phonon_qt5_backend_gstreamer
-      pkgs.gst_all_1.gstreamer
-      pkgs.gst_all_1.gst-plugins-base
-      pkgs.gst_all_1.gst-plugins-good
-      pkgs.gst_all_1.gst-plugins-ugly
-      pkgs.gst_all_1.gst-plugins-bad
-      pkgs.gst_all_1.gst-libav # for mp3 playback
-    ];
-
-    vlc = [
-      pkgs.phonon_qt5_backend_vlc
-      pkgs.phonon_backend_vlc
-    ];
-  };
-
-  phononBackendPackages = flip concatMap cfg.phononBackends
-    (name: attrByPath [name] (throw "unknown phonon backend `${name}'") phononBackends);
-
   kf5 = pkgs.kf5_stable;
-
-  plasma5 = pkgs.plasma5_stable.override { inherit kf5; };
-
-  kdeApps = pkgs.kdeApps_stable.override { inherit kf5; };
+  plasma5 = pkgs.plasma5_stable;
+  kdeApps = pkgs.kdeApps_stable;
 
 in
 
@@ -53,14 +24,24 @@ in
         description = "Enable the Plasma 5 (KDE 5) desktop environment.";
       };
 
-      phononBackends = mkOption {
-        type = types.listOf types.str;
-        default = ["gstreamer"];
-        example = ["gstreamer" "vlc"];
-        description = ''
-          Phonon backends to use in KDE. Only the VLC and GStreamer backends are
-          available. The GStreamer backend is preferred by upstream.
-        '';
+      phonon = {
+
+        gstreamer = {
+          enable = mkOption {
+            type = types.bool;
+            default = true;
+            description = "Enable the GStreamer Phonon backend (recommended).";
+          };
+        };
+
+        vlc = {
+          enable = mkOption {
+            type = types.bool;
+            default = false;
+            description = "Enable the VLC Phonon backend.";
+          };
+        };
+
       };
 
     };
@@ -88,23 +69,77 @@ in
     };
 
     environment.systemPackages =
-      filter isDerivation (builtins.attrValues plasma5)
-      ++ filter isDerivation (builtins.attrValues kf5)
-      ++ [
+      [
         pkgs.qt4 # qtconfig is the only way to set Qt 4 theme
 
-        kdeApps.kde-baseapps
-        kdeApps.kde-base-artwork
-        kdeApps.kmix
+        kf5.frameworkintegration
+        kf5.kinit
+
+        plasma5.breeze
+        plasma5.kde-cli-tools
+        plasma5.kdeplasma-addons
+        plasma5.kgamma5
+        plasma5.khelpcenter
+        plasma5.khotkeys
+        plasma5.kinfocenter
+        plasma5.kmenuedit
+        plasma5.kscreen
+        plasma5.ksysguard
+        plasma5.kwayland
+        plasma5.kwin
+        plasma5.kwrited
+        plasma5.milou
+        plasma5.oxygen
+        plasma5.polkit-kde-agent
+        plasma5.systemsettings
+
+        plasma5.plasma-desktop
+        plasma5.plasma-workspace
+        plasma5.plasma-workspace-wallpapers
+
+        kdeApps.ark
+        kdeApps.dolphin
+        kdeApps.dolphin-plugins
+        kdeApps.ffmpegthumbs
+        kdeApps.gwenview
+        kdeApps.kate
+        kdeApps.kdegraphics-thumbnailers
         kdeApps.konsole
-        kdeApps.oxygen-icons
-
-        kdeApps.kde-runtime
+        kdeApps.okular
+        kdeApps.print-manager
 
+        kdeApps.oxygen-icons
         pkgs.hicolor_icon_theme
 
+        plasma5.kde-gtk-config
         pkgs.orion # GTK theme, nearly identical to Breeze
-      ] ++ phononBackendPackages;
+      ]
+      ++ lib.optional config.hardware.bluetooth.enable plasma5.bluedevil
+      ++ lib.optional config.networking.networkmanager.enable plasma5.plasma-nm
+      ++ lib.optional config.hardware.pulseaudio.enable plasma5.plasma-pa
+      ++ lib.optional config.powerManagement.enable plasma5.powerdevil
+      ++ lib.optionals cfg.phonon.gstreamer.enable
+        [
+          pkgs.phonon_backend_gstreamer
+          pkgs.gst_all.gstreamer
+          pkgs.gst_all.gstPluginsBase
+          pkgs.gst_all.gstPluginsGood
+          pkgs.gst_all.gstPluginsUgly
+          pkgs.gst_all.gstPluginsBad
+          pkgs.gst_all.gstFfmpeg # for mp3 playback
+          pkgs.phonon_qt5_backend_gstreamer
+          pkgs.gst_all_1.gstreamer
+          pkgs.gst_all_1.gst-plugins-base
+          pkgs.gst_all_1.gst-plugins-good
+          pkgs.gst_all_1.gst-plugins-ugly
+          pkgs.gst_all_1.gst-plugins-bad
+          pkgs.gst_all_1.gst-libav # for mp3 playback
+        ]
+      ++ lib.optionals cfg.phonon.vlc.enable
+        [
+          pkgs.phonon_qt5_backend_vlc
+          pkgs.phonon_backend_vlc
+        ];
 
     environment.pathsToLink = [ "/share" ];
 
@@ -114,7 +149,7 @@ in
     };
 
     environment.profileRelativeEnvVars =
-      mkIf (lib.elem "gstreamer" cfg.phononBackends)
+      mkIf cfg.phonon.gstreamer.enable
       {
         GST_PLUGIN_SYSTEM_PATH = [ "/lib/gstreamer-0.10" ];
         GST_PLUGIN_SYSTEM_PATH_1_0 = [ "/lib/gstreamer-1.0" ];
diff --git a/nixos/modules/services/x11/display-managers/gdm.nix b/nixos/modules/services/x11/display-managers/gdm.nix
index c9a563768323..58eb6f050131 100644
--- a/nixos/modules/services/x11/display-managers/gdm.nix
+++ b/nixos/modules/services/x11/display-managers/gdm.nix
@@ -20,7 +20,9 @@ in
 
       enable = mkEnableOption ''
         GDM as the display manager.
-        <emphasis>GDM is very experimental and may render system unusable.</emphasis>
+        <emphasis>GDM in NixOS is not well-tested with desktops other
+        than GNOME, so use with caution, as it could render the
+        system unusable.</emphasis>
       '';
 
       debug = mkEnableOption ''
diff --git a/nixos/modules/services/x11/display-managers/sddm.nix b/nixos/modules/services/x11/display-managers/sddm.nix
index 3f1d190ae66b..16a0d1b6d963 100644
--- a/nixos/modules/services/x11/display-managers/sddm.nix
+++ b/nixos/modules/services/x11/display-managers/sddm.nix
@@ -35,8 +35,23 @@ let
     SessionCommand=${dmcfg.session.script}
     SessionDir=${dmcfg.session.desktops}
     XauthPath=${pkgs.xorg.xauth}/bin/xauth
+
+    ${optionalString cfg.autoLogin.enable ''
+    [Autologin]
+    User=${cfg.autoLogin.user}
+    Session=${defaultSessionName}.desktop
+    Relogin=${if cfg.autoLogin.relogin then "true" else "false"}
+    ''}
+
+    ${cfg.extraConfig}
   '';
 
+  defaultSessionName =
+    let
+      dm = xcfg.desktopManager.default;
+      wm = xcfg.windowManager.default;
+    in dm + optionalString (wm != "none") (" + " + wm);
+
 in
 {
   options = {
@@ -50,6 +65,19 @@ in
         '';
       };
 
+      extraConfig = mkOption {
+        type = types.str;
+        default = "";
+        example = ''
+          [Autologin]
+          User=john
+          Session=plasma.desktop
+        '';
+        description = ''
+          Extra lines appended to the configuration of SDDM.
+        '';
+      };
+
       theme = mkOption {
         type = types.str;
         default = "maui";
@@ -57,12 +85,62 @@ in
           Greeter theme to use.
         '';
       };
+
+      autoLogin = mkOption {
+        default = {};
+        description = ''
+          Configuration for automatic login.
+        '';
+
+        type = types.submodule {
+	  options = {
+            enable = mkOption {
+              type = types.bool;
+              default = false;
+              description = ''
+                Automatically log in as the sepecified <option>autoLogin.user</option>.
+              '';
+            };
+
+            user = mkOption {
+              type = types.nullOr types.str;
+              default = null;
+              description = ''
+                User to be used for the autologin.
+              '';
+            };
+
+            relogin = mkOption {
+              type = types.bool;
+              default = false;
+              description = ''
+                If true automatic login will kick in again on session exit, otherwise it
+                will work only the first time.
+              '';
+            };
+	  };
+        };
+      };
+
     };
 
   };
 
   config = mkIf cfg.enable {
 
+    assertions = [
+      { assertion = cfg.autoLogin.enable -> cfg.autoLogin.user != null;
+        message = "SDDM auto-login requires services.xserver.displayManager.sddm.autoLogin.user to be set";
+      }
+      { assertion = cfg.autoLogin.enable -> elem defaultSessionName dmcfg.session.names;
+        message = ''
+          SDDM auto-login requires that services.xserver.desktopManager.default and
+	  services.xserver.windowMananger.default are set to valid values. The current
+	  default session: ${defaultSessionName} is not valid.
+	'';
+      }
+    ];
+
     services.xserver.displayManager.slim.enable = false;
 
     services.xserver.displayManager.job = {
@@ -93,6 +171,18 @@ in
         session  optional       pam_keyinit.so force revoke
         session  optional       pam_permit.so
       '';
+
+      sddm-autologin.text = ''
+        auth     requisite pam_nologin.so
+        auth     required  pam_succeed_if.so uid >= 1000 quiet
+        auth     required  pam_permit.so
+
+        account  include   sddm
+
+        password include   sddm
+
+        session  include   sddm
+      '';
     };
 
     users.extraUsers.sddm = {
diff --git a/nixos/modules/services/x11/redshift.nix b/nixos/modules/services/x11/redshift.nix
index ffae22d2d670..d40373ec2e55 100644
--- a/nixos/modules/services/x11/redshift.nix
+++ b/nixos/modules/services/x11/redshift.nix
@@ -22,14 +22,16 @@ in {
     latitude = mkOption {
       type = types.str;
       description = ''
-        Your current latitude.
+        Your current latitude, between
+        <literal>-90.0</literal> and <literal>90.0</literal>.
       '';
     };
 
     longitude = mkOption {
       type = types.str;
       description = ''
-        Your current longitude.
+        Your current longitude, between
+        between <literal>-180.0</literal> and <literal>180.0</literal>.
       '';
     };
 
@@ -38,14 +40,16 @@ in {
         type = types.int;
         default = 5500;
         description = ''
-          Colour temperature to use during the day.
+          Colour temperature to use during the day, between
+          <literal>1000</literal> and <literal>25000</literal> K.
         '';
       };
       night = mkOption {
         type = types.int;
         default = 3700;
         description = ''
-          Colour temperature to use at night.
+          Colour temperature to use at night, between
+          <literal>1000</literal> and <literal>25000</literal> K.
         '';
       };
     };
diff --git a/nixos/modules/services/x11/window-managers/clfswm.nix b/nixos/modules/services/x11/window-managers/clfswm.nix
new file mode 100644
index 000000000000..9d8eecb56c77
--- /dev/null
+++ b/nixos/modules/services/x11/window-managers/clfswm.nix
@@ -0,0 +1,31 @@
+{ config, lib, pkgs, ... }:
+
+with lib;
+
+let
+  cfg = config.services.xserver.windowManager.clfswm;
+in
+
+{
+  options = {
+    services.xserver.windowManager.clfswm = {
+      enable = mkOption {
+        type = types.bool;
+        default = false;
+        example = true;
+        description = "Enable the clfswm tiling window manager.";
+      };
+    };
+  };
+
+  config = mkIf cfg.enable {
+    services.xserver.windowManager.session = singleton {
+      name = "clfswm";
+      start = ''
+        ${pkgs.clfswm}/bin/clfswm &
+        waitPID=$!
+      '';
+    };
+    environment.systemPackages = [ pkgs.clfswm ];
+  };
+}
diff --git a/nixos/modules/services/x11/window-managers/default.nix b/nixos/modules/services/x11/window-managers/default.nix
index 4751de07a15d..31f42f5ffb9f 100644
--- a/nixos/modules/services/x11/window-managers/default.nix
+++ b/nixos/modules/services/x11/window-managers/default.nix
@@ -10,6 +10,7 @@ in
   imports = [
     ./afterstep.nix
     ./bspwm.nix
+    ./clfswm.nix
     ./compiz.nix
     ./fluxbox.nix
     ./herbstluftwm.nix
diff --git a/nixos/modules/services/x11/window-managers/xmonad.nix b/nixos/modules/services/x11/window-managers/xmonad.nix
index c922ca7848d1..288800d514d3 100644
--- a/nixos/modules/services/x11/window-managers/xmonad.nix
+++ b/nixos/modules/services/x11/window-managers/xmonad.nix
@@ -20,9 +20,9 @@ in
       };
 
       haskellPackages = mkOption {
-        default = pkgs.haskellngPackages;
-        defaultText = "pkgs.haskellngPackages";
-        example = literalExample "pkgs.haskell-ng.packages.ghc784";
+        default = pkgs.haskellPackages;
+        defaultText = "pkgs.haskellPackages";
+        example = literalExample "pkgs.haskell.packages.ghc784";
         description = ''
           haskellPackages used to build Xmonad and other packages.
           This can be used to change the GHC version used to build