* Change the default desktop manager from "xterm" to the last imported

and enabled desktop manager (e.g. "kde" if KDE is enabled, and
  "xterm" if nothing is explicitly enabled).  This means that you
  don't have to write

    services.xserver.desktopManager.default = "kde4";

  anymore in addition to

    services.xserver.desktopManager.kde4.enable = true;

  to make KDE the default desktop environment.
  
* Remove the "none + none" session type.

* Remove the "+ none" string at the end of session types.  I.e. now
  it's "kde", not "kde + none".

* In kdm, add coreutils to its SystemPath so that it can remove the
  temporary directories in /tmp that it creates.

svn path=/nixos/trunk/; revision=23036
This commit is contained in:
Eelco Dolstra 2010-08-08 14:05:32 +00:00
parent 87dcdc05fe
commit 6e118cd66b
4 changed files with 25 additions and 25 deletions

View File

@ -117,10 +117,6 @@
./services/web-servers/jboss.nix
./services/web-servers/tomcat.nix
./services/x11/desktop-managers/default.nix
./services/x11/desktop-managers/gnome.nix
./services/x11/desktop-managers/kde4.nix
./services/x11/desktop-managers/none.nix
./services/x11/desktop-managers/xterm.nix
./services/x11/display-managers/default.nix
./services/x11/display-managers/auto.nix
./services/x11/display-managers/kdm.nix

View File

@ -1,22 +1,23 @@
{pkgs, config, ...}:
{ config, pkgs, ... }:
with pkgs.lib;
let
inherit (pkgs.lib) mkOption mergeOneOption mkIf filter optionalString any;
xcfg = config.services.xserver;
cfg = xcfg.desktopManager;
# Whether desktop manager `d' is capable of setting a background.
# If it isn't, the `feh' program is used as a fallback.
needBGCond = d: ! (d ? bgSupport && d.bgSupport);
in
{
imports = [
./kde4.nix
./gnome.nix
./xterm.nix
./none.nix
];
# Note: the order in which desktop manager modules are imported here
# determines the default: later modules (if enabled) are preferred.
# E.g., if KDE is enabled, it supersedes xterm.
imports = [ ./none.nix ./xterm.nix ./gnome.nix ./kde4.nix ];
options = {
@ -24,11 +25,11 @@ in
session = mkOption {
default = [];
example = [{
name = "kde";
bgSupport = true;
start = "...";
}];
example = singleton
{ name = "kde";
bgSupport = true;
start = "...";
};
description = "
Internal option used to add some common line to desktop manager
scripts before forwarding the value to the
@ -48,16 +49,15 @@ in
};
};
default = mkOption {
default = "xterm";
default = "";
example = "none";
description = "
Default desktop manager loaded if none have been chosen.
";
description = "Default desktop manager loaded if none have been chosen.";
merge = mergeOneOption;
apply = defaultDM:
if any (w: w.name == defaultDM) cfg.session.list then
if defaultDM == "" && cfg.session.list != [] then
(head cfg.session.list).name
else if any (w: w.name == defaultDM) cfg.session.list then
defaultDM
else
throw "Default desktop manager ($(defaultDM)) not found.";

View File

@ -23,7 +23,7 @@ let
# The first argument of this script is the session type.
sessionType="$1"
if test "$sessionType" = default; then sessionType=""; fi
if [ "$sessionType" = default ]; then sessionType=""; fi
${optionalString (!cfg.displayManager.job.logsXsession) ''
exec > ~/.xsession-errors 2>&1
@ -180,7 +180,9 @@ in
apply = list: rec {
wm = filter (s: s.manage == "window") list;
dm = filter (s: s.manage == "desktop") list;
names = concatMap (d: map (w: d.name + " + " + w.name) wm) dm;
names = flip concatMap dm
(d: map (w: d.name + optionalString (w.name != "none") (" + " + w.name))
(filter (w: d.name != "none" || w.name != "none") wm));
desktops = mkDesktops names;
script = xsession wm dm;
};

View File

@ -26,6 +26,8 @@ let
[X-:*-Core]
ServerCmd=${dmcfg.xserverBin} ${dmcfg.xserverArgs}
# KDM calls `rm' somewhere to clean up some temporary directory.
SystemPath=${pkgs.coreutils}/bin
# The default timeout (15) is too short in a heavily loaded boot process.
ServerTimeout=60
# Needed to prevent the X server from dying on logout and not coming back: