1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-20 04:48:10 +00:00
nixpkgs/nixos/modules/services/x11/desktop-managers/kde5.nix

146 lines
3.7 KiB
Nix
Raw Normal View History

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;
phononBackends = {
gstreamer = [
pkgs.phonon_backend_gstreamer
2015-02-21 17:00:25 +00:00
pkgs.gst_all.gstreamer
2015-01-19 17:39:23 +00:00
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
2015-02-21 17:00:25 +00:00
pkgs.gst_all_1.gstreamer
2015-01-19 17:39:23 +00:00
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
];
vlc = [
pkgs.phonon_qt5_backend_vlc
pkgs.phonon_backend_vlc
];
};
phononBackendPackages = flip concatMap cfg.phononBackends
(name: attrByPath [name] (throw "unknown phonon backend `${name}'") phononBackends);
kf5 = pkgs.kf5_stable;
2015-01-19 17:39:23 +00:00
plasma5 = pkgs.plasma5_stable;
2015-01-19 17:39:23 +00:00
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.";
};
phononBackends = mkOption {
type = types.listOf types.str;
default = ["gstreamer"];
example = ["gstreamer" "vlc"];
description = ''
Phonon backends to use in KDE. Only the VLC and gstreamer backends are
available. The VLC backend is preferred by upstream.
'';
};
};
};
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-01-25 20:34:59 +00:00
start = ''exec ${plasma5.startkde}/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;
};
environment.systemPackages = with plasma5; with kf5;
2015-01-25 20:34:59 +00:00
(builtins.attrValues
(removeAttrs plasma5
[ "deepOverride" "override" "overrideDerivation"
"recurseForDerivations" "scope"
]))
++
(builtins.attrValues
(removeAttrs kf5
[ "deepOverride" "extra-cmake-modules" "mkDerivation" "override"
"overrideDerivation" "recurseForDerivations" "scope"
]))
++
2015-01-19 17:39:23 +00: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
kdeApps.kde-baseapps
kdeApps.kde-base-artwork
2015-01-25 20:34:59 +00:00
kdeApps.kde-workspace
kdeApps.kde-runtime
kdeApps.kmix
2015-01-19 17:39:23 +00:00
kdeApps.konsole
kdeApps.oxygen-icons
pkgs.hicolor_icon_theme
2015-01-25 20:34:59 +00:00
pkgs.orion # GTK theme, nearly identical to Breeze
2015-01-19 17:39:23 +00:00
]
++ (optional config.networking.networkmanager.enable plasma-nm)
++ phononBackendPackages;
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 =
mkIf (lib.elem "gstreamer" cfg.phononBackends)
{
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
fonts.fonts = [ plasma5.oxygen-fonts ];
# Enable helpful DBus services.
services.udisks2.enable = true;
services.upower.enable = config.powerManagement.enable;
security.pam.services.kde = { allowNullPassword = true; };
};
}