2015-01-19 17:39:23 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
|
|
|
|
xcfg = config.services.xserver;
|
2015-01-24 16:34:25 +00:00
|
|
|
cfg = xcfg.desktopManager.kde5;
|
2015-01-19 17:39:23 +00:00
|
|
|
xorg = pkgs.xorg;
|
|
|
|
|
2015-06-15 16:50:39 +01:00
|
|
|
kf5 = pkgs.kf5_stable;
|
2015-10-07 12:46:48 +01:00
|
|
|
plasma5 = pkgs.plasma5_stable;
|
|
|
|
kdeApps = pkgs.kdeApps_stable;
|
2015-01-19 17:39:23 +00:00
|
|
|
|
|
|
|
in
|
|
|
|
|
|
|
|
{
|
|
|
|
options = {
|
|
|
|
|
2015-01-24 16:34:25 +00:00
|
|
|
services.xserver.desktopManager.kde5 = {
|
2015-01-19 17:39:23 +00:00
|
|
|
enable = mkOption {
|
|
|
|
type = types.bool;
|
|
|
|
default = false;
|
|
|
|
description = "Enable the Plasma 5 (KDE 5) desktop environment.";
|
|
|
|
};
|
|
|
|
|
2015-10-17 16:47:04 +01: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 17:39:23 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
config = mkIf (xcfg.enable && cfg.enable) {
|
|
|
|
|
2015-01-24 16:34:37 +00: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 17:39:23 +00:00
|
|
|
services.xserver.desktopManager.session = singleton {
|
2015-01-24 16:34:25 +00:00
|
|
|
name = "kde5";
|
2015-01-19 17:39:23 +00:00
|
|
|
bgSupport = true;
|
2015-05-03 23:09:50 +01:00
|
|
|
start = ''exec ${plasma5.plasma-workspace}/bin/startkde;'';
|
2015-01-19 17:39:23 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
security.setuidOwners = singleton {
|
|
|
|
program = "kcheckpass";
|
|
|
|
source = "${plasma5.plasma-workspace}/lib/libexec/kcheckpass";
|
|
|
|
owner = "root";
|
|
|
|
group = "root";
|
|
|
|
setuid = true;
|
|
|
|
};
|
|
|
|
|
2015-02-21 17:01:10 +00:00
|
|
|
environment.systemPackages =
|
2015-10-17 16:40:33 +01:00
|
|
|
[
|
2015-01-25 20:34:59 +00:00
|
|
|
pkgs.qt4 # qtconfig is the only way to set Qt 4 theme
|
2015-01-19 17:39:23 +00:00
|
|
|
|
2015-10-18 19:42:36 +01:00
|
|
|
kf5.frameworkintegration
|
2015-10-17 16:40:33 +01:00
|
|
|
kf5.kinit
|
|
|
|
|
|
|
|
plasma5.breeze
|
|
|
|
plasma5.kde-cli-tools
|
|
|
|
plasma5.kdeplasma-addons
|
|
|
|
plasma5.kgamma5
|
|
|
|
plasma5.khelpcenter
|
|
|
|
plasma5.khotkeys
|
|
|
|
plasma5.kinfocenter
|
|
|
|
plasma5.kmenuedit
|
|
|
|
plasma5.kscreen
|
|
|
|
plasma5.ksysguard
|
|
|
|
plasma5.kwayland
|
|
|
|
plasma5.kwin
|
|
|
|
plasma5.kwrited
|
|
|
|
plasma5.milou
|
|
|
|
plasma5.oxygen
|
|
|
|
plasma5.polkit-kde-agent
|
|
|
|
plasma5.systemsettings
|
|
|
|
|
|
|
|
plasma5.plasma-desktop
|
|
|
|
plasma5.plasma-workspace
|
|
|
|
plasma5.plasma-workspace-wallpapers
|
|
|
|
|
2015-10-28 00:42:53 +00:00
|
|
|
kdeApps.ark
|
2015-10-07 12:46:48 +01:00
|
|
|
kdeApps.dolphin
|
2015-10-27 16:57:58 +00:00
|
|
|
kdeApps.dolphin-plugins
|
2015-10-28 00:42:53 +00:00
|
|
|
kdeApps.ffmpegthumbs
|
|
|
|
kdeApps.gwenview
|
|
|
|
kdeApps.kate
|
|
|
|
kdeApps.kdegraphics-thumbnailers
|
2015-01-19 17:39:23 +00:00
|
|
|
kdeApps.konsole
|
2015-10-28 00:42:53 +00:00
|
|
|
kdeApps.okular
|
|
|
|
kdeApps.print-manager
|
2015-03-11 14:34:56 +00:00
|
|
|
|
2015-12-10 16:28:36 +00:00
|
|
|
# Oxygen icons moved to KDE Frameworks 5.16 and later.
|
2015-11-23 19:46:10 +00:00
|
|
|
(kdeApps.oxygen-icons or kf5.oxygen-icons5)
|
2015-01-19 17:39:23 +00:00
|
|
|
pkgs.hicolor_icon_theme
|
|
|
|
|
2015-10-17 16:40:33 +01:00
|
|
|
plasma5.kde-gtk-config
|
2015-01-25 20:34:59 +00:00
|
|
|
pkgs.orion # GTK theme, nearly identical to Breeze
|
2015-10-17 16:40:33 +01:00
|
|
|
]
|
|
|
|
++ lib.optional config.hardware.bluetooth.enable plasma5.bluedevil
|
|
|
|
++ lib.optional config.networking.networkmanager.enable plasma5.plasma-nm
|
|
|
|
++ lib.optional config.hardware.pulseaudio.enable plasma5.plasma-pa
|
|
|
|
++ lib.optional config.powerManagement.enable plasma5.powerdevil
|
2015-10-17 16:47:04 +01: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
|
|
|
|
pkgs.phonon_qt5_backend_gstreamer
|
|
|
|
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
|
|
|
|
]
|
|
|
|
++ lib.optionals cfg.phonon.vlc.enable
|
|
|
|
[
|
|
|
|
pkgs.phonon_qt5_backend_vlc
|
|
|
|
pkgs.phonon_backend_vlc
|
|
|
|
];
|
2015-01-19 17:39:23 +00:00
|
|
|
|
|
|
|
environment.pathsToLink = [ "/share" ];
|
|
|
|
|
|
|
|
environment.etc = singleton {
|
|
|
|
source = "${pkgs.xkeyboard_config}/etc/X11/xkb";
|
|
|
|
target = "X11/xkb";
|
|
|
|
};
|
|
|
|
|
2015-01-24 16:34:25 +00:00
|
|
|
environment.profileRelativeEnvVars =
|
2015-10-17 16:47:04 +01:00
|
|
|
mkIf cfg.phonon.gstreamer.enable
|
2015-01-24 16:34:25 +00:00
|
|
|
{
|
|
|
|
GST_PLUGIN_SYSTEM_PATH = [ "/lib/gstreamer-0.10" ];
|
|
|
|
GST_PLUGIN_SYSTEM_PATH_1_0 = [ "/lib/gstreamer-1.0" ];
|
|
|
|
};
|
2015-01-19 17:39:23 +00:00
|
|
|
|
2015-11-22 16:27:39 +00:00
|
|
|
fonts.fonts = [ (plasma5.oxygen-fonts or pkgs.noto-fonts) ];
|
2015-01-19 17:39:23 +00:00
|
|
|
|
2015-03-11 16:00:22 +00:00
|
|
|
programs.ssh.askPassword = "${plasma5.ksshaskpass}/bin/ksshaskpass";
|
|
|
|
|
2015-01-19 17:39:23 +00:00
|
|
|
# Enable helpful DBus services.
|
|
|
|
services.udisks2.enable = true;
|
|
|
|
services.upower.enable = config.powerManagement.enable;
|
|
|
|
|
2015-02-21 17:01:56 +00:00
|
|
|
# Extra UDEV rules used by Solid
|
|
|
|
services.udev.packages = [ pkgs.media-player-info ];
|
|
|
|
|
2015-01-19 17:39:23 +00:00
|
|
|
security.pam.services.kde = { allowNullPassword = true; };
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|