2009-01-25 16:49:08 +01:00
|
|
|
{pkgs, config, ...}:
|
|
|
|
|
|
|
|
let
|
|
|
|
inherit (pkgs.lib) mkOption mkIf;
|
2009-06-26 00:08:03 +02:00
|
|
|
xcfg = config.services.xserver;
|
|
|
|
cfg = xcfg.desktopManager.kde;
|
|
|
|
xorg = xcfg.package;
|
2009-01-25 16:49:08 +01:00
|
|
|
|
|
|
|
options = { services = { xserver = { desktopManager = {
|
|
|
|
|
|
|
|
kde = {
|
|
|
|
enable = mkOption {
|
|
|
|
default = false;
|
|
|
|
example = true;
|
|
|
|
description = "Enable the kde desktop manager.";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
}; }; }; };
|
|
|
|
in
|
|
|
|
|
2009-06-26 00:08:03 +02:00
|
|
|
mkIf (xcfg.enable && cfg.enable) {
|
2009-04-12 00:12:02 +02:00
|
|
|
require = [
|
|
|
|
options
|
|
|
|
|
|
|
|
# environment.kdePackages
|
2009-05-25 11:02:29 +02:00
|
|
|
./kde-environment.nix
|
2009-04-12 00:12:02 +02:00
|
|
|
];
|
2009-01-25 16:49:08 +01:00
|
|
|
|
|
|
|
services = {
|
|
|
|
xserver = {
|
|
|
|
|
|
|
|
desktopManager = {
|
|
|
|
session = [{
|
|
|
|
name = "kde";
|
|
|
|
start = ''
|
2009-04-28 15:40:55 +02:00
|
|
|
# A quick hack to make KDE screen locking work. It calls
|
|
|
|
# kcheckpass, which needs to be setuid in order to read the
|
|
|
|
# shadow password file. We have a setuid wrapper around
|
|
|
|
# kcheckpass. However, startkde adds $kdebase/bin to the start
|
|
|
|
# of $PATH if it's not already in $PATH, thus overriding the
|
|
|
|
# setuid wrapper directory. So here we add $kdebase/bin to the
|
|
|
|
# end of $PATH to keep startkde from doing that.
|
|
|
|
export PATH=$PATH:${pkgs.kdebase}/bin
|
|
|
|
|
2009-01-25 16:49:08 +01:00
|
|
|
# Start KDE.
|
|
|
|
exec ${pkgs.kdebase}/bin/startkde
|
|
|
|
'';
|
|
|
|
}];
|
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
security = {
|
|
|
|
extraSetuidPrograms = [
|
|
|
|
"kcheckpass"
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
environment = {
|
2009-04-12 00:12:02 +02:00
|
|
|
kdePackages = [
|
2009-01-25 16:49:08 +01:00
|
|
|
pkgs.kdelibs
|
|
|
|
pkgs.kdebase
|
2009-04-12 00:12:02 +02:00
|
|
|
];
|
|
|
|
|
2009-06-26 00:08:03 +02:00
|
|
|
x11Packages = [
|
2009-01-25 16:49:08 +01:00
|
|
|
xorg.xset # used by startkde, non-essential
|
|
|
|
];
|
|
|
|
|
|
|
|
etc = [
|
|
|
|
{ source = "${pkgs.xkeyboard_config}/etc/X11/xkb";
|
|
|
|
target = "X11/xkb";
|
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
|
|
|
}
|