kdm: drop service
This commit is contained in:
parent
5627dd27b9
commit
3cec7d10df
|
@ -64,7 +64,7 @@
|
|||
cups = 36;
|
||||
foldingathome = 37;
|
||||
sabnzbd = 38;
|
||||
kdm = 39;
|
||||
#kdm = 39; # dropped in 17.03
|
||||
ghostone = 40;
|
||||
git = 41;
|
||||
fourstore = 42;
|
||||
|
@ -333,7 +333,7 @@
|
|||
#cups = 36; # unused
|
||||
#foldingathome = 37; # unused
|
||||
#sabnzd = 38; # unused
|
||||
#kdm = 39; # unused
|
||||
#kdm = 39; # unused, even before 17.03
|
||||
ghostone = 40;
|
||||
git = 41;
|
||||
fourstore = 42;
|
||||
|
|
|
@ -559,7 +559,6 @@
|
|||
./services/x11/display-managers/auto.nix
|
||||
./services/x11/display-managers/default.nix
|
||||
./services/x11/display-managers/gdm.nix
|
||||
./services/x11/display-managers/kdm.nix
|
||||
./services/x11/display-managers/lightdm.nix
|
||||
./services/x11/display-managers/sddm.nix
|
||||
./services/x11/display-managers/slim.nix
|
||||
|
|
|
@ -1,202 +0,0 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
|
||||
xcfg = config.services.xserver;
|
||||
cfg = xcfg.desktopManager.kde4;
|
||||
xorg = pkgs.xorg;
|
||||
kde_workspace = config.services.xserver.desktopManager.kde4.kdeWorkspacePackage;
|
||||
|
||||
# Disable Nepomuk and Strigi by default. As of KDE 4.7, they don't
|
||||
# really work very well (e.g. searching files often fails to find
|
||||
# files), segfault sometimes and consume significant resources.
|
||||
# They can be re-enabled in the KDE System Settings under "Desktop
|
||||
# Search".
|
||||
disableNepomuk = pkgs.writeTextFile
|
||||
{ name = "nepomuk-config";
|
||||
destination = "/share/config/nepomukserverrc";
|
||||
text =
|
||||
''
|
||||
[Basic Settings]
|
||||
Start Nepomuk=false
|
||||
|
||||
[Service-nepomukstrigiservice]
|
||||
autostart=false
|
||||
'';
|
||||
};
|
||||
|
||||
phononBackends = {
|
||||
gstreamer = [
|
||||
pkgs.phonon-backend-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.gst_all.gstreamer # needed?
|
||||
];
|
||||
|
||||
vlc = [pkgs.phonon-backend-vlc];
|
||||
};
|
||||
|
||||
phononBackendPackages = flip concatMap cfg.phononBackends
|
||||
(name: attrByPath [name] (throw "unknown phonon backend `${name}'") phononBackends);
|
||||
|
||||
in
|
||||
|
||||
{
|
||||
options = {
|
||||
|
||||
services.xserver.desktopManager.kde4 = {
|
||||
enable = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = "Enable the KDE 4 desktop environment.";
|
||||
};
|
||||
|
||||
phononBackends = mkOption {
|
||||
type = types.listOf types.str;
|
||||
default = ["gstreamer"];
|
||||
example = ["gstreamer" "vlc"];
|
||||
description = "Which phonon multimedia backend kde should use";
|
||||
};
|
||||
|
||||
kdeWorkspacePackage = mkOption {
|
||||
internal = true;
|
||||
default = pkgs.kde4.kde_workspace;
|
||||
defaultText = "pkgs.kde4.kde_workspace";
|
||||
type = types.package;
|
||||
description = "Custom kde-workspace, used for NixOS rebranding.";
|
||||
};
|
||||
|
||||
enablePIM = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
description = "Whether to enable PIM support. Note that enabling this pulls in Akonadi and MariaDB as dependencies.";
|
||||
};
|
||||
|
||||
enableNepomuk = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = "Whether to enable Nepomuk (deprecated).";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
config = mkIf (xcfg.enable && cfg.enable) {
|
||||
warnings = [
|
||||
"KDE4 is long unmaintained and will be removed. Please update to KDE5."
|
||||
];
|
||||
|
||||
# If KDE 4 is enabled, make it the default desktop manager (unless
|
||||
# overridden by the user's configuration).
|
||||
# !!! doesn't work yet ("Multiple definitions. Only one is allowed
|
||||
# for this option.")
|
||||
# services.xserver.desktopManager.default = mkOverride 900 "kde4";
|
||||
|
||||
services.xserver.desktopManager.session = singleton
|
||||
{ name = "kde4";
|
||||
bgSupport = true;
|
||||
start =
|
||||
''
|
||||
# The KDE icon cache is supposed to update itself
|
||||
# automatically, but it uses the timestamp on the icon
|
||||
# theme directory as a trigger. Since in Nix the
|
||||
# timestamp is always the same, this doesn't work. So as
|
||||
# a workaround, nuke the icon cache on login. This isn't
|
||||
# perfect, since it may require logging out after
|
||||
# installing new applications to update the cache.
|
||||
# See http://lists-archives.org/kde-devel/26175-what-when-will-icon-cache-refresh.html
|
||||
rm -fv $HOME/.kde/cache-*/icon-cache.kcache
|
||||
|
||||
# Qt writes a weird ‘libraryPath’ line to
|
||||
# ~/.config/Trolltech.conf that causes the KDE plugin
|
||||
# paths of previous KDE invocations to be searched.
|
||||
# Obviously using mismatching KDE libraries is potentially
|
||||
# disastrous, so here we nuke references to the Nix store
|
||||
# in Trolltech.conf. A better solution would be to stop
|
||||
# Qt from doing this wackiness in the first place.
|
||||
if [ -e $HOME/.config/Trolltech.conf ]; then
|
||||
sed -e '/nix\\store\|nix\/store/ d' -i $HOME/.config/Trolltech.conf
|
||||
fi
|
||||
|
||||
# Load PulseAudio module for routing support.
|
||||
# See http://colin.guthr.ie/2009/10/so-how-does-the-kde-pulseaudio-support-work-anyway/
|
||||
${optionalString config.hardware.pulseaudio.enable ''
|
||||
${getBin config.hardware.pulseaudio.package}/bin/pactl load-module module-device-manager "do_routing=1"
|
||||
''}
|
||||
|
||||
# Start KDE.
|
||||
exec ${kde_workspace}/bin/startkde
|
||||
'';
|
||||
};
|
||||
|
||||
security.setuidOwners = singleton
|
||||
{ program = "kcheckpass";
|
||||
source = "${kde_workspace}/lib/kde4/libexec/kcheckpass";
|
||||
owner = "root";
|
||||
group = "root";
|
||||
setuid = true;
|
||||
};
|
||||
|
||||
environment.systemPackages =
|
||||
[ pkgs.kde4.kdelibs
|
||||
|
||||
pkgs.kde4.kde_baseapps # Splitted kdebase
|
||||
kde_workspace
|
||||
pkgs.kde4.kde_runtime
|
||||
pkgs.kde4.konsole
|
||||
pkgs.kde4.kate
|
||||
|
||||
pkgs.kde4.kde_wallpapers # contains kdm's default background
|
||||
pkgs.kde4.oxygen_icons
|
||||
|
||||
# Starts KDE's Polkit authentication agent.
|
||||
pkgs.kde4.polkit_kde_agent
|
||||
|
||||
# Miscellaneous runtime dependencies.
|
||||
pkgs.kde4.qt4 # needed for qdbus
|
||||
pkgs.shared_mime_info
|
||||
xorg.xmessage # so that startkde can show error messages
|
||||
xorg.xset # used by startkde, non-essential
|
||||
xorg.xauth # used by kdesu
|
||||
]
|
||||
++ optionals cfg.enablePIM
|
||||
[ pkgs.kde4.kdepim_runtime
|
||||
pkgs.kde4.akonadi
|
||||
pkgs.mysql # used by akonadi
|
||||
]
|
||||
++ (if cfg.enableNepomuk then
|
||||
[ pkgs.shared_desktop_ontologies # used by nepomuk
|
||||
pkgs.strigi # used by nepomuk
|
||||
pkgs.virtuoso # to enable Nepomuk to find Virtuoso
|
||||
] else
|
||||
[ disableNepomuk ])
|
||||
++ optional config.hardware.pulseaudio.enable pkgs.kde4.kmix # Perhaps this should always be enabled
|
||||
++ optional config.hardware.bluetooth.enable pkgs.kde4.bluedevil
|
||||
++ optional config.networking.networkmanager.enable pkgs.kde4.plasma-nm
|
||||
++ phononBackendPackages;
|
||||
|
||||
environment.pathsToLink = [ "/share" ];
|
||||
|
||||
environment.profileRelativeEnvVars = mkIf (elem "gstreamer" cfg.phononBackends) {
|
||||
GST_PLUGIN_SYSTEM_PATH = [ "/lib/gstreamer-0.10" ];
|
||||
};
|
||||
|
||||
environment.etc = singleton
|
||||
{ source = "${pkgs.xkeyboard_config}/etc/X11/xkb";
|
||||
target = "X11/xkb";
|
||||
};
|
||||
|
||||
# Enable helpful DBus services.
|
||||
services.udisks2.enable = true;
|
||||
services.upower.enable = config.powerManagement.enable;
|
||||
|
||||
security.pam.services.kde = { allowNullPassword = true; };
|
||||
|
||||
};
|
||||
|
||||
}
|
|
@ -55,9 +55,6 @@ let
|
|||
fi
|
||||
''}
|
||||
|
||||
# Handle being called by kdm.
|
||||
if test "''${1:0:1}" = /; then eval exec "$1"; fi
|
||||
|
||||
# Start PulseAudio if enabled.
|
||||
${optionalString (config.hardware.pulseaudio.enable) ''
|
||||
${optionalString (!config.hardware.pulseaudio.systemWide)
|
||||
|
|
|
@ -1,161 +0,0 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
|
||||
dmcfg = config.services.xserver.displayManager;
|
||||
cfg = dmcfg.kdm;
|
||||
|
||||
inherit (pkgs.kde4) kdebase_workspace;
|
||||
|
||||
defaultConfig =
|
||||
''
|
||||
[Shutdown]
|
||||
HaltCmd=${config.systemd.package}/sbin/shutdown -h now
|
||||
RebootCmd=${config.systemd.package}/sbin/shutdown -r now
|
||||
${optionalString (config.system.boot.loader.id == "grub") ''
|
||||
BootManager=${if config.boot.loader.grub.version == 2 then "Grub2" else "Grub"}
|
||||
''}
|
||||
|
||||
[X-*-Core]
|
||||
Xrdb=${pkgs.xorg.xrdb}/bin/xrdb
|
||||
SessionsDirs=${dmcfg.session.desktops}
|
||||
Session=${dmcfg.session.script}
|
||||
FailsafeClient=${pkgs.xterm}/bin/xterm
|
||||
|
||||
[X-:*-Core]
|
||||
ServerCmd=${dmcfg.xserverBin} ${toString 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:
|
||||
TerminateServer=true
|
||||
${optionalString (cfg.setupScript != "")
|
||||
''
|
||||
Setup=${cfg.setupScript}
|
||||
''}
|
||||
|
||||
[X-*-Greeter]
|
||||
HiddenUsers=root,${concatStringsSep "," dmcfg.hiddenUsers}
|
||||
PluginsLogin=${kdebase_workspace}/lib/kde4/kgreet_classic.so
|
||||
${optionalString (cfg.themeDirectory != null)
|
||||
''
|
||||
UseTheme=true
|
||||
Theme=${cfg.themeDirectory}
|
||||
''
|
||||
}
|
||||
|
||||
${optionalString (cfg.enableXDMCP)
|
||||
''
|
||||
[Xdmcp]
|
||||
Enable=true
|
||||
''}
|
||||
'';
|
||||
|
||||
kdmrc = pkgs.runCommand "kdmrc"
|
||||
{ config = defaultConfig + cfg.extraConfig;
|
||||
preferLocalBuild = true;
|
||||
}
|
||||
''
|
||||
echo "$config" > $out
|
||||
|
||||
# The default kdmrc would add "-nolisten tcp", and we already
|
||||
# have that managed by nixos. Hence the grep.
|
||||
cat ${kdebase_workspace}/share/config/kdm/kdmrc | grep -v nolisten >> $out
|
||||
'';
|
||||
|
||||
in
|
||||
|
||||
{
|
||||
|
||||
###### interface
|
||||
|
||||
options = {
|
||||
|
||||
services.xserver.displayManager.kdm = {
|
||||
|
||||
enable = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = ''
|
||||
Whether to enable the KDE display manager.
|
||||
'';
|
||||
};
|
||||
|
||||
enableXDMCP = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = ''
|
||||
Whether to enable XDMCP, which allows remote logins.
|
||||
'';
|
||||
};
|
||||
|
||||
themeDirectory = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
default = null;
|
||||
description = ''
|
||||
The path to a KDM theme directory. This theme
|
||||
will be used by the KDM greeter.
|
||||
'';
|
||||
};
|
||||
|
||||
setupScript = mkOption {
|
||||
type = types.lines;
|
||||
default = "";
|
||||
description = ''
|
||||
The path to a KDM setup script. This script is run as root just
|
||||
before KDM starts. Can be used for setting up
|
||||
monitors with xrandr, for example.
|
||||
'';
|
||||
};
|
||||
|
||||
extraConfig = mkOption {
|
||||
type = types.lines;
|
||||
default = "";
|
||||
description = ''
|
||||
Options appended to <filename>kdmrc</filename>, the
|
||||
configuration file of KDM.
|
||||
'';
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
|
||||
###### implementation
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
warnings = [
|
||||
"KDM is long unmaintained and will be removed. Please update to SDDM."
|
||||
];
|
||||
|
||||
services.xserver.displayManager.slim.enable = false;
|
||||
|
||||
services.xserver.displayManager.job =
|
||||
{ execCmd =
|
||||
''
|
||||
mkdir -m 0755 -p /var/lib/kdm
|
||||
chown kdm /var/lib/kdm
|
||||
${(optionalString (config.system.boot.loader.id == "grub" && config.system.build.grub != null) "PATH=${config.system.build.grub}/sbin:$PATH ") +
|
||||
"KDEDIRS=/run/current-system/sw exec ${kdebase_workspace}/bin/kdm -config ${kdmrc} -nodaemon -logfile /dev/stderr"}
|
||||
'';
|
||||
logsXsession = true;
|
||||
};
|
||||
|
||||
security.pam.services.kde = { allowNullPassword = true; startSession = true; };
|
||||
|
||||
users.extraUsers = singleton
|
||||
{ name = "kdm";
|
||||
uid = config.ids.uids.kdm;
|
||||
description = "KDM user";
|
||||
};
|
||||
|
||||
environment.systemPackages =
|
||||
[ pkgs.kde4.kde_wallpapers ]; # contains kdm's default background
|
||||
|
||||
};
|
||||
|
||||
}
|
|
@ -256,8 +256,6 @@ else {
|
|||
# ‘grub-reboot’ sets a one-time saved entry, which we process here and
|
||||
# then delete.
|
||||
if [ \"\${next_entry}\" ]; then
|
||||
# FIXME: KDM expects the next line to be present.
|
||||
set default=\"\${saved_entry}\"
|
||||
set default=\"\${next_entry}\"
|
||||
set next_entry=
|
||||
save_env next_entry
|
||||
|
|
|
@ -123,15 +123,6 @@ let kernel = config.boot.kernelPackages.kernel; in
|
|||
users.extraUsers.root.initialHashedPassword = mkOverride 150 "";
|
||||
|
||||
services.xserver.displayManager.logToJournal = true;
|
||||
|
||||
# Bump kdm's X server start timeout to account for heavily loaded
|
||||
# VM host systems.
|
||||
services.xserver.displayManager.kdm.extraConfig =
|
||||
''
|
||||
[X-:*-Core]
|
||||
ServerTimeout=240
|
||||
'';
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -1,70 +0,0 @@
|
|||
import ./make-test.nix ({ pkgs, ... }: {
|
||||
name = "kde4";
|
||||
meta = with pkgs.stdenv.lib.maintainers; {
|
||||
maintainers = [ domenkozar eelco chaoflow ];
|
||||
};
|
||||
|
||||
machine =
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
{ imports = [ ./common/user-account.nix ];
|
||||
|
||||
virtualisation.memorySize = 1024;
|
||||
|
||||
services.xserver.enable = true;
|
||||
|
||||
services.httpd.enable = true;
|
||||
services.httpd.adminAddr = "foo@example.org";
|
||||
services.httpd.documentRoot = "${pkgs.valgrind.doc}/share/doc/valgrind/html";
|
||||
|
||||
services.xserver.displayManager.kdm.enable = true;
|
||||
services.xserver.displayManager.kdm.extraConfig =
|
||||
''
|
||||
[X-:0-Core]
|
||||
AutoLoginEnable=true
|
||||
AutoLoginUser=alice
|
||||
AutoLoginPass=foobar
|
||||
'';
|
||||
|
||||
services.xserver.desktopManager.kde4.enable = true;
|
||||
|
||||
# Include most of KDE. We don't really test these here, but at
|
||||
# least they should build.
|
||||
environment.systemPackages =
|
||||
[ pkgs.kde4.kdemultimedia
|
||||
pkgs.kde4.kdegraphics
|
||||
pkgs.kde4.kdeutils
|
||||
pkgs.kde4.kdegames
|
||||
#pkgs.kde4.kdeedu
|
||||
pkgs.kde4.kdeaccessibility
|
||||
pkgs.kde4.kdeadmin
|
||||
pkgs.kde4.kdenetwork
|
||||
pkgs.kde4.kdetoys
|
||||
pkgs.kde4.kdewebdev
|
||||
pkgs.xorg.xmessage
|
||||
];
|
||||
};
|
||||
|
||||
testScript = ''
|
||||
$machine->waitUntilSucceeds("pgrep plasma-desktop");
|
||||
$machine->succeed("xauth merge ~alice/.Xauthority");
|
||||
$machine->waitForWindow(qr/plasma-desktop/);
|
||||
|
||||
# Check that logging in has given the user ownership of devices.
|
||||
$machine->succeed("getfacl /dev/snd/timer | grep -q alice");
|
||||
|
||||
$machine->execute("su - alice -c 'DISPLAY=:0.0 kwrite /var/log/messages &'");
|
||||
$machine->waitForWindow(qr/messages.*KWrite/);
|
||||
|
||||
$machine->execute("su - alice -c 'DISPLAY=:0.0 konqueror http://localhost/ &'");
|
||||
$machine->waitForWindow(qr/Valgrind.*Konqueror/);
|
||||
|
||||
$machine->execute("su - alice -c 'DISPLAY=:0.0 gwenview ${pkgs.kde4.kde_wallpapers}/share/wallpapers/Hanami/contents/images/1280x1024.jpg &'");
|
||||
$machine->waitForWindow(qr/Gwenview/);
|
||||
|
||||
$machine->sleep(10);
|
||||
|
||||
$machine->screenshot("screen");
|
||||
'';
|
||||
|
||||
})
|
Loading…
Reference in a new issue