2015-01-19 18:39:23 +01:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
|
|
|
|
xcfg = config.services.xserver;
|
2015-01-24 17:34:25 +01:00
|
|
|
cfg = xcfg.desktopManager.kde5;
|
2015-01-19 18:39:23 +01:00
|
|
|
xorg = pkgs.xorg;
|
|
|
|
|
2015-12-16 16:44:07 +01:00
|
|
|
kde5 = pkgs.kde5;
|
2015-01-19 18:39:23 +01:00
|
|
|
|
|
|
|
in
|
|
|
|
|
|
|
|
{
|
|
|
|
options = {
|
|
|
|
|
2015-01-24 17:34:25 +01:00
|
|
|
services.xserver.desktopManager.kde5 = {
|
2015-01-19 18:39:23 +01:00
|
|
|
enable = mkOption {
|
|
|
|
type = types.bool;
|
|
|
|
default = false;
|
|
|
|
description = "Enable the Plasma 5 (KDE 5) desktop environment.";
|
|
|
|
};
|
|
|
|
|
2015-10-17 17:47:04 +02:00
|
|
|
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.";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2015-01-19 18:39:23 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
config = mkIf (xcfg.enable && cfg.enable) {
|
|
|
|
|
2015-01-24 17:34:37 +01:00
|
|
|
warnings = optional config.services.xserver.desktopManager.kde4.enable
|
|
|
|
"KDE 4 should not be enabled at the same time as KDE 5";
|
|
|
|
|
2015-01-19 18:39:23 +01:00
|
|
|
services.xserver.desktopManager.session = singleton {
|
2015-01-24 17:34:25 +01:00
|
|
|
name = "kde5";
|
2015-01-19 18:39:23 +01:00
|
|
|
bgSupport = true;
|
2015-12-16 16:44:07 +01:00
|
|
|
start = ''exec ${kde5.plasma-workspace}/bin/startkde;'';
|
2015-01-19 18:39:23 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
security.setuidOwners = singleton {
|
|
|
|
program = "kcheckpass";
|
2015-12-16 16:44:07 +01:00
|
|
|
source = "${kde5.plasma-workspace}/lib/libexec/kcheckpass";
|
2015-01-19 18:39:23 +01:00
|
|
|
owner = "root";
|
|
|
|
group = "root";
|
|
|
|
setuid = true;
|
|
|
|
};
|
|
|
|
|
2015-02-21 18:01:10 +01:00
|
|
|
environment.systemPackages =
|
2015-10-17 17:40:33 +02:00
|
|
|
[
|
2015-01-25 21:34:59 +01:00
|
|
|
pkgs.qt4 # qtconfig is the only way to set Qt 4 theme
|
2015-01-19 18:39:23 +01:00
|
|
|
|
2015-12-16 16:44:07 +01:00
|
|
|
kde5.frameworkintegration
|
|
|
|
kde5.kinit
|
|
|
|
|
|
|
|
kde5.breeze
|
|
|
|
kde5.kde-cli-tools
|
|
|
|
kde5.kdeplasma-addons
|
|
|
|
kde5.kgamma5
|
|
|
|
kde5.khelpcenter
|
|
|
|
kde5.khotkeys
|
|
|
|
kde5.kinfocenter
|
|
|
|
kde5.kmenuedit
|
|
|
|
kde5.kscreen
|
|
|
|
kde5.ksysguard
|
|
|
|
kde5.kwayland
|
|
|
|
kde5.kwin
|
|
|
|
kde5.kwrited
|
|
|
|
kde5.milou
|
|
|
|
kde5.oxygen
|
|
|
|
kde5.polkit-kde-agent
|
|
|
|
kde5.systemsettings
|
|
|
|
|
|
|
|
kde5.plasma-desktop
|
|
|
|
kde5.plasma-workspace
|
|
|
|
kde5.plasma-workspace-wallpapers
|
|
|
|
|
|
|
|
kde5.ark
|
|
|
|
kde5.dolphin
|
|
|
|
kde5.dolphin-plugins
|
|
|
|
kde5.ffmpegthumbs
|
|
|
|
kde5.gwenview
|
|
|
|
kde5.kate
|
|
|
|
kde5.kdegraphics-thumbnailers
|
|
|
|
kde5.konsole
|
|
|
|
kde5.okular
|
|
|
|
kde5.print-manager
|
2015-03-11 15:34:56 +01:00
|
|
|
|
2015-12-10 17:28:36 +01:00
|
|
|
# Oxygen icons moved to KDE Frameworks 5.16 and later.
|
2015-12-16 16:44:07 +01:00
|
|
|
(kde5.oxygen-icons or kde5.oxygen-icons5)
|
2015-01-19 18:39:23 +01:00
|
|
|
pkgs.hicolor_icon_theme
|
|
|
|
|
2015-12-16 16:44:07 +01:00
|
|
|
kde5.kde-gtk-config
|
2015-10-17 17:40:33 +02:00
|
|
|
]
|
2015-12-10 17:29:25 +01:00
|
|
|
|
|
|
|
# Plasma 5.5 and later has a Breeze GTK theme.
|
|
|
|
# If it is not available, Orion is very similar to Breeze.
|
2015-12-16 16:44:07 +01:00
|
|
|
++ lib.optional (!(lib.hasAttr "breeze-gtk" kde5)) pkgs.orion
|
2015-12-10 17:29:52 +01:00
|
|
|
|
|
|
|
# Install Breeze icons if available
|
2015-12-16 16:44:07 +01:00
|
|
|
++ lib.optional (lib.hasAttr "breeze-icons" kde5) kde5.breeze-icons
|
2015-12-10 17:30:09 +01:00
|
|
|
|
|
|
|
# Optional hardware support features
|
2015-12-16 16:44:07 +01:00
|
|
|
++ lib.optional config.hardware.bluetooth.enable kde5.bluedevil
|
|
|
|
++ lib.optional config.networking.networkmanager.enable kde5.plasma-nm
|
|
|
|
++ lib.optional config.hardware.pulseaudio.enable kde5.plasma-pa
|
|
|
|
++ lib.optional config.powerManagement.enable kde5.powerdevil
|
2016-01-08 16:04:04 +01:00
|
|
|
++ lib.optionals config.services.samba.enable [ kde5.kdenetwork-filesharing pkgs.samba ]
|
2015-12-10 17:30:09 +01:00
|
|
|
|
2015-10-17 17:47:04 +02:00
|
|
|
++ 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
|
2015-12-20 15:02:42 +01:00
|
|
|
pkgs.qt55.phonon-backend-gstreamer
|
2015-10-17 17:47:04 +02:00
|
|
|
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
|
|
|
|
]
|
2015-12-10 17:30:09 +01:00
|
|
|
|
2015-10-17 17:47:04 +02:00
|
|
|
++ lib.optionals cfg.phonon.vlc.enable
|
|
|
|
[
|
|
|
|
pkgs.phonon_qt5_backend_vlc
|
2015-12-20 15:03:26 +01:00
|
|
|
pkgs.qt55.phonon-backend-vlc
|
2015-10-17 17:47:04 +02:00
|
|
|
];
|
2015-01-19 18:39:23 +01:00
|
|
|
|
|
|
|
environment.pathsToLink = [ "/share" ];
|
|
|
|
|
|
|
|
environment.etc = singleton {
|
|
|
|
source = "${pkgs.xkeyboard_config}/etc/X11/xkb";
|
|
|
|
target = "X11/xkb";
|
|
|
|
};
|
|
|
|
|
2015-01-24 17:34:25 +01:00
|
|
|
environment.profileRelativeEnvVars =
|
2015-10-17 17:47:04 +02:00
|
|
|
mkIf cfg.phonon.gstreamer.enable
|
2015-01-24 17:34:25 +01:00
|
|
|
{
|
|
|
|
GST_PLUGIN_SYSTEM_PATH = [ "/lib/gstreamer-0.10" ];
|
|
|
|
GST_PLUGIN_SYSTEM_PATH_1_0 = [ "/lib/gstreamer-1.0" ];
|
|
|
|
};
|
2015-01-19 18:39:23 +01:00
|
|
|
|
2015-12-12 21:32:47 +01:00
|
|
|
# Enable GTK applications to load SVG icons
|
2015-12-16 16:44:07 +01:00
|
|
|
environment.variables = mkIf (lib.hasAttr "breeze-icons" kde5) {
|
2015-12-12 21:32:47 +01:00
|
|
|
GDK_PIXBUF_MODULE_FILE = "${pkgs.librsvg}/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache";
|
|
|
|
};
|
|
|
|
|
2015-12-16 16:44:07 +01:00
|
|
|
fonts.fonts = [ (kde5.oxygen-fonts or pkgs.noto-fonts) ];
|
2015-01-19 18:39:23 +01:00
|
|
|
|
2015-12-16 16:44:07 +01:00
|
|
|
programs.ssh.askPassword = "${kde5.ksshaskpass}/bin/ksshaskpass";
|
2015-03-11 17:00:22 +01:00
|
|
|
|
2015-01-19 18:39:23 +01:00
|
|
|
# Enable helpful DBus services.
|
|
|
|
services.udisks2.enable = true;
|
|
|
|
services.upower.enable = config.powerManagement.enable;
|
|
|
|
|
2015-02-21 18:01:56 +01:00
|
|
|
# Extra UDEV rules used by Solid
|
|
|
|
services.udev.packages = [ pkgs.media-player-info ];
|
|
|
|
|
2015-12-11 13:58:28 +01:00
|
|
|
services.xserver.displayManager.sddm = {
|
|
|
|
theme = "breeze";
|
|
|
|
themes = [
|
2015-12-16 16:44:07 +01:00
|
|
|
kde5.plasma-workspace
|
|
|
|
(kde5.oxygen-icons or kde5.oxygen-icons5)
|
2015-12-11 13:58:28 +01:00
|
|
|
];
|
|
|
|
};
|
|
|
|
|
2015-01-19 18:39:23 +01:00
|
|
|
security.pam.services.kde = { allowNullPassword = true; };
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|