1{
2 mkDerivation,
3 lib,
4 extra-cmake-modules,
5 kdoctools,
6 wayland-scanner,
7 isocodes,
8 libdbusmenu,
9 libSM,
10 libXcursor,
11 libXtst,
12 libXft,
13 pam,
14 wayland,
15 xmessage,
16 xsetroot,
17 baloo,
18 breeze-qt5,
19 kactivities,
20 kactivities-stats,
21 kcmutils,
22 kconfig,
23 kcrash,
24 kdbusaddons,
25 kdeclarative,
26 kdelibs4support,
27 kdesu,
28 kglobalaccel,
29 kidletime,
30 kinit,
31 kjsembed,
32 knewstuff,
33 knotifyconfig,
34 kpackage,
35 kpeople,
36 krunner,
37 kscreenlocker,
38 ktexteditor,
39 ktextwidgets,
40 kwallet,
41 kwayland,
42 kwin,
43 kxmlrpcclient,
44 libkscreen,
45 libksysguard,
46 libqalculate,
47 networkmanager-qt,
48 phonon,
49 plasma-framework,
50 prison,
51 solid,
52 kholidays,
53 kquickcharts,
54 appstream-qt,
55 plasma-wayland-protocols,
56 kpipewire,
57 libkexiv2,
58 kuserfeedback,
59 qtgraphicaleffects,
60 qtquickcontrols,
61 qtquickcontrols2,
62 qtscript,
63 qttools,
64 qtwayland,
65 qtx11extras,
66 qqc2-desktop-style,
67 polkit-qt,
68 pipewire,
69 libdrm,
70 fetchpatch,
71}:
72
73let
74 inherit (lib) getBin getLib;
75in
76
77mkDerivation {
78 pname = "plasma-workspace";
79 passthru.providedSessions = [
80 "plasma"
81 "plasmawayland"
82 ];
83
84 nativeBuildInputs = [
85 extra-cmake-modules
86 kdoctools
87 wayland-scanner
88 ];
89 buildInputs = [
90 isocodes
91 libdbusmenu
92 libSM
93 libXcursor
94 libXtst
95 libXft
96 pam
97 wayland
98
99 baloo
100 kactivities
101 kactivities-stats
102 kcmutils
103 kconfig
104 kcrash
105 kdbusaddons
106 kdeclarative
107 kdelibs4support
108 kdesu
109 kglobalaccel
110 kidletime
111 kjsembed
112 knewstuff
113 knotifyconfig
114 kpackage
115 kpeople
116 krunner
117 kscreenlocker
118 ktexteditor
119 ktextwidgets
120 kwallet
121 kwayland
122 kwin
123 kxmlrpcclient
124 libkscreen
125 libksysguard
126 libqalculate
127 networkmanager-qt
128 phonon
129 plasma-framework
130 prison
131 solid
132 kholidays
133 kquickcharts
134 appstream-qt
135 plasma-wayland-protocols
136 kpipewire
137 libkexiv2
138
139 kuserfeedback
140 qtgraphicaleffects
141 qtquickcontrols
142 qtquickcontrols2
143 qtscript
144 qtwayland
145 qtx11extras
146 qqc2-desktop-style
147 polkit-qt
148
149 pipewire
150 libdrm
151 ];
152 propagatedUserEnvPkgs = [ qtgraphicaleffects ];
153 outputs = [
154 "out"
155 "dev"
156 ];
157
158 cmakeFlags = [
159 ''-DNIXPKGS_BREEZE_WALLPAPERS=${getBin breeze-qt5}/share/wallpapers''
160 ];
161
162 patches = [
163 ./0001-startkde.patch
164 ./0002-absolute-wallpaper-install-dir.patch
165
166 # Backport patch for cleaner shutdowns
167 (fetchpatch {
168 url = "https://invent.kde.org/plasma/plasma-workspace/-/commit/6ce8f434139f47e6a71bf0b68beae92be8845ce4.patch";
169 hash = "sha256-cYw/4/9tSnCbArLr72O8F8V0NLkVXdCVnJGoGxSzZMg=";
170 })
171 ];
172
173 # QT_INSTALL_BINS refers to qtbase, and qdbus is in qttools
174 postPatch = ''
175 substituteInPlace CMakeLists.txt \
176 --replace 'ecm_query_qt(QtBinariesDir QT_INSTALL_BINS)' 'set(QtBinariesDir "${lib.getBin qttools}/bin")'
177 '';
178
179 # work around wrapQtAppsHook double-wrapping kcminit_startup,
180 # which is a symlink to kcminit
181 postFixup = ''
182 ln -sf $out/bin/kcminit $out/bin/kcminit_startup
183 '';
184
185 env.NIX_CFLAGS_COMPILE = toString [
186 ''-DNIXPKGS_XMESSAGE="${getBin xmessage}/bin/xmessage"''
187 ''-DNIXPKGS_XSETROOT="${getBin xsetroot}/bin/xsetroot"''
188 ''-DNIXPKGS_START_KDEINIT_WRAPPER="${getLib kinit}/libexec/kf5/start_kdeinit_wrapper"''
189 ''-DNIXPKGS_KDEINIT5_SHUTDOWN="${getBin kinit}/bin/kdeinit5_shutdown"''
190 ];
191}