2015-01-19 18:39:23 +01:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
|
|
|
|
xcfg = config.services.xserver;
|
2017-02-25 21:43:13 +01:00
|
|
|
cfg = xcfg.desktopManager.plasma5;
|
2015-01-19 18:39:23 +01:00
|
|
|
|
2017-02-25 21:43:13 +01:00
|
|
|
inherit (pkgs) kdeWrapper kdeApplications plasma5 libsForQt5 qt5 xorg;
|
2015-01-19 18:39:23 +01:00
|
|
|
|
|
|
|
in
|
|
|
|
|
|
|
|
{
|
|
|
|
options = {
|
|
|
|
|
2017-02-25 21:43:13 +01:00
|
|
|
services.xserver.desktopManager.plasma5 = {
|
2015-01-19 18:39:23 +01:00
|
|
|
enable = mkOption {
|
|
|
|
type = types.bool;
|
|
|
|
default = false;
|
|
|
|
description = "Enable the Plasma 5 (KDE 5) desktop environment.";
|
|
|
|
};
|
|
|
|
|
2016-11-14 16:59:22 +01:00
|
|
|
enableQt4Support = mkOption {
|
|
|
|
type = types.bool;
|
|
|
|
default = true;
|
|
|
|
description = ''
|
|
|
|
Enable support for Qt 4-based applications. Particularly, install the
|
|
|
|
Qt 4 version of the Breeze theme and a default backend for Phonon.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2016-12-28 14:53:19 +01:00
|
|
|
extraPackages = mkOption {
|
|
|
|
type = types.listOf types.package;
|
|
|
|
default = [];
|
|
|
|
description = ''
|
|
|
|
KDE packages that need to be installed system-wide.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2015-01-19 18:39:23 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2016-12-28 14:53:19 +01:00
|
|
|
config = mkMerge [
|
|
|
|
(mkIf (cfg.extraPackages != []) {
|
2017-02-25 21:43:13 +01:00
|
|
|
environment.systemPackages = [ (kdeWrapper cfg.extraPackages) ];
|
2016-12-28 14:53:19 +01:00
|
|
|
})
|
2015-01-19 18:39:23 +01:00
|
|
|
|
2016-12-28 14:53:19 +01:00
|
|
|
(mkIf (xcfg.enable && cfg.enable) {
|
|
|
|
services.xserver.desktopManager.session = singleton {
|
2017-02-25 21:43:13 +01:00
|
|
|
name = "plasma5";
|
2016-12-28 14:53:19 +01:00
|
|
|
bgSupport = true;
|
|
|
|
start = ''
|
|
|
|
# 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"
|
|
|
|
''}
|
2016-04-14 23:34:45 +02:00
|
|
|
|
2017-02-25 19:25:44 +01:00
|
|
|
exec "${plasma5.startkde}"
|
2016-12-28 14:53:19 +01:00
|
|
|
'';
|
|
|
|
};
|
2015-01-19 18:39:23 +01:00
|
|
|
|
2017-01-29 08:58:12 +01:00
|
|
|
security.wrappers = {
|
2017-02-25 19:25:44 +01:00
|
|
|
kcheckpass.source = "${plasma5.plasma-workspace.out}/lib/libexec/kcheckpass";
|
2017-02-26 13:49:15 +01:00
|
|
|
"start_kdeinit".source = "${pkgs.kinit.out}/lib/libexec/kf5/start_kdeinit";
|
2017-01-29 08:58:12 +01:00
|
|
|
};
|
2015-12-11 13:58:28 +01:00
|
|
|
|
2017-02-26 13:49:15 +01:00
|
|
|
environment.systemPackages = with pkgs; with qt5; with libsForQt5; with plasma5; with kdeApplications;
|
2016-12-28 14:53:19 +01:00
|
|
|
[
|
2017-02-25 19:25:44 +01:00
|
|
|
frameworkintegration
|
|
|
|
kactivities
|
|
|
|
kauth
|
|
|
|
kcmutils
|
|
|
|
kconfig
|
|
|
|
kconfigwidgets
|
|
|
|
kcoreaddons
|
|
|
|
kdbusaddons
|
|
|
|
kdeclarative
|
|
|
|
kded
|
|
|
|
kdesu
|
|
|
|
kdnssd
|
|
|
|
kemoticons
|
|
|
|
kfilemetadata
|
|
|
|
kglobalaccel
|
|
|
|
kguiaddons
|
|
|
|
kiconthemes
|
|
|
|
kidletime
|
|
|
|
kimageformats
|
|
|
|
kinit
|
|
|
|
kio
|
|
|
|
kjobwidgets
|
|
|
|
knewstuff
|
|
|
|
knotifications
|
|
|
|
knotifyconfig
|
|
|
|
kpackage
|
|
|
|
kparts
|
|
|
|
kpeople
|
|
|
|
krunner
|
|
|
|
kservice
|
|
|
|
ktextwidgets
|
|
|
|
kwallet
|
|
|
|
kwallet-pam
|
|
|
|
kwalletmanager
|
|
|
|
kwayland
|
|
|
|
kwidgetsaddons
|
|
|
|
kxmlgui
|
|
|
|
kxmlrpcclient
|
|
|
|
plasma-framework
|
|
|
|
solid
|
|
|
|
sonnet
|
|
|
|
threadweaver
|
|
|
|
|
|
|
|
breeze-qt5
|
|
|
|
kactivitymanagerd
|
|
|
|
kde-cli-tools
|
|
|
|
kdecoration
|
|
|
|
kdeplasma-addons
|
|
|
|
kgamma5
|
|
|
|
khotkeys
|
|
|
|
kinfocenter
|
|
|
|
kmenuedit
|
|
|
|
kscreen
|
|
|
|
kscreenlocker
|
|
|
|
ksysguard
|
|
|
|
kwayland
|
|
|
|
kwin
|
|
|
|
kwrited
|
|
|
|
libkscreen
|
|
|
|
libksysguard
|
|
|
|
milou
|
|
|
|
plasma-integration
|
|
|
|
polkit-kde-agent
|
|
|
|
systemsettings
|
|
|
|
|
|
|
|
plasma-desktop
|
|
|
|
plasma-workspace
|
|
|
|
plasma-workspace-wallpapers
|
|
|
|
|
|
|
|
dolphin-plugins
|
|
|
|
ffmpegthumbs
|
|
|
|
kdegraphics-thumbnailers
|
|
|
|
kio-extras
|
|
|
|
print-manager
|
|
|
|
|
|
|
|
breeze-icons
|
2016-12-28 14:53:19 +01:00
|
|
|
pkgs.hicolor_icon_theme
|
|
|
|
|
2017-02-25 19:25:44 +01:00
|
|
|
kde-gtk-config breeze-gtk
|
2016-12-28 14:53:19 +01:00
|
|
|
|
2017-02-25 19:25:44 +01:00
|
|
|
phonon-backend-gstreamer
|
2016-12-28 14:53:19 +01:00
|
|
|
]
|
|
|
|
|
2017-02-25 19:25:44 +01:00
|
|
|
++ lib.optionals cfg.enableQt4Support [ breeze-qt4 pkgs.phonon-backend-gstreamer ]
|
2016-12-28 14:53:19 +01:00
|
|
|
|
|
|
|
# Optional hardware support features
|
2017-02-25 19:25:44 +01:00
|
|
|
++ lib.optional config.hardware.bluetooth.enable bluedevil
|
|
|
|
++ lib.optional config.networking.networkmanager.enable plasma-nm
|
|
|
|
++ lib.optional config.hardware.pulseaudio.enable plasma-pa
|
|
|
|
++ lib.optional config.powerManagement.enable powerdevil
|
|
|
|
++ lib.optional config.services.colord.enable colord-kde
|
|
|
|
++ lib.optionals config.services.samba.enable [ kdenetwork-filesharing pkgs.samba ];
|
2016-12-28 14:53:19 +01:00
|
|
|
|
2017-02-25 21:43:13 +01:00
|
|
|
services.xserver.desktopManager.plasma5.extraPackages =
|
2017-02-25 19:25:44 +01:00
|
|
|
with kdeApplications; with plasma5;
|
2016-12-28 14:53:19 +01:00
|
|
|
[
|
2017-02-25 19:25:44 +01:00
|
|
|
khelpcenter
|
|
|
|
oxygen
|
2016-12-28 14:53:19 +01:00
|
|
|
|
2017-02-25 19:25:44 +01:00
|
|
|
dolphin
|
|
|
|
konsole
|
2016-12-28 14:53:19 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
environment.pathsToLink = [ "/share" ];
|
|
|
|
|
2017-01-30 14:03:42 +01:00
|
|
|
environment.etc = singleton {
|
|
|
|
source = "${pkgs.xkeyboard_config}/etc/X11/xkb";
|
|
|
|
target = "X11/xkb";
|
|
|
|
};
|
2015-01-19 18:39:23 +01:00
|
|
|
|
2017-02-25 19:25:44 +01:00
|
|
|
environment.variables = {
|
|
|
|
# Enable GTK applications to load SVG icons
|
|
|
|
GST_PLUGIN_SYSTEM_PATH_1_0 =
|
|
|
|
lib.makeSearchPath "/lib/gstreamer-1.0"
|
|
|
|
(builtins.map (pkg: pkg.out) (with pkgs.gst_all_1; [
|
|
|
|
gstreamer
|
|
|
|
gst-plugins-base
|
|
|
|
gst-plugins-good
|
|
|
|
gst-plugins-ugly
|
|
|
|
gst-plugins-bad
|
|
|
|
gst-libav # for mp3 playback
|
|
|
|
]));
|
|
|
|
GDK_PIXBUF_MODULE_FILE = "${pkgs.librsvg.out}/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache";
|
|
|
|
};
|
|
|
|
|
|
|
|
fonts.fonts = with pkgs; [ noto-fonts hack-font ];
|
2017-03-04 21:50:15 +01:00
|
|
|
fonts.fontconfig.defaultFonts = {
|
|
|
|
monospace = [ "Hack" "Noto Mono" ];
|
|
|
|
sansSerif = [ "Noto Sans" ];
|
|
|
|
serif = [ "Noto Serif" ];
|
|
|
|
};
|
2016-12-28 14:53:19 +01:00
|
|
|
|
2017-02-25 19:25:44 +01:00
|
|
|
programs.ssh.askPassword = "${plasma5.ksshaskpass.out}/bin/ksshaskpass";
|
2016-12-28 14:53:19 +01:00
|
|
|
|
|
|
|
# Enable helpful DBus services.
|
|
|
|
services.udisks2.enable = true;
|
|
|
|
services.upower.enable = config.powerManagement.enable;
|
2017-01-18 19:50:04 +01:00
|
|
|
services.dbus.packages =
|
|
|
|
mkIf config.services.printing.enable [ pkgs.system-config-printer ];
|
2016-12-28 14:53:19 +01:00
|
|
|
|
|
|
|
# Extra UDEV rules used by Solid
|
|
|
|
services.udev.packages = [
|
|
|
|
pkgs.libmtp
|
|
|
|
pkgs.media-player-info
|
2015-12-11 13:58:28 +01:00
|
|
|
];
|
|
|
|
|
2016-12-28 14:53:19 +01:00
|
|
|
services.xserver.displayManager.sddm = {
|
|
|
|
theme = "breeze";
|
2017-02-26 13:49:15 +01:00
|
|
|
themes = [
|
|
|
|
pkgs.extra-cmake-modules # for the setup-hook
|
|
|
|
plasma5.plasma-workspace
|
|
|
|
pkgs.breeze-icons
|
2016-12-28 14:53:19 +01:00
|
|
|
];
|
|
|
|
};
|
2015-01-19 18:39:23 +01:00
|
|
|
|
2016-12-28 14:53:19 +01:00
|
|
|
security.pam.services.kde = { allowNullPassword = true; };
|
|
|
|
|
2017-02-15 01:38:52 +01:00
|
|
|
# Doing these one by one seems silly, but we currently lack a better
|
|
|
|
# construct for handling common pam configs.
|
|
|
|
security.pam.services.gdm.enableKwallet = true;
|
|
|
|
security.pam.services.kdm.enableKwallet = true;
|
|
|
|
security.pam.services.lightdm.enableKwallet = true;
|
|
|
|
security.pam.services.sddm.enableKwallet = true;
|
|
|
|
security.pam.services.slim.enableKwallet = true;
|
|
|
|
|
2017-01-24 19:55:06 +01:00
|
|
|
# use kimpanel as the default IBus panel
|
|
|
|
i18n.inputMethod.ibus.panel =
|
|
|
|
lib.mkDefault
|
2017-02-25 19:25:44 +01:00
|
|
|
"${plasma5.plasma-desktop}/lib/libexec/kimpanel-ibus-panel";
|
2017-01-24 19:55:06 +01:00
|
|
|
|
2016-12-28 14:53:19 +01:00
|
|
|
})
|
|
|
|
];
|
2015-01-19 18:39:23 +01:00
|
|
|
|
|
|
|
}
|