@@ -1,1008 +0,0 @@
1−diff --git a/sddm-theme/theme.conf.cmake b/sddm-theme/theme.conf.cmake
2−index ea9a943..f98ddd2 100644
3−--- a/sddm-theme/theme.conf.cmake
4−+++ b/sddm-theme/theme.conf.cmake
5−@@ -2,4 +2,4 @@
6− type=image
7− color=#1d99f3
8− fontSize=10
9−-background=${CMAKE_INSTALL_PREFIX}/${WALLPAPER_INSTALL_DIR}/Next/contents/images/5120x2880.png
10−+background=${NIXPKGS_WALLPAPER_INSTALL_DIR}/Next/contents/images/5120x2880.png
11−diff --git a/startkde/CMakeLists.txt b/startkde/CMakeLists.txt
12−index 6a1a212..f03fd34 100644
13−--- a/startkde/CMakeLists.txt
14−+++ b/startkde/CMakeLists.txt
15−@@ -4,11 +4,6 @@ add_subdirectory(ksyncdbusenv)
16− add_subdirectory(waitforname)
17− add_subdirectory(kcheckrunning)
18−
19−-#FIXME: reconsider, looks fishy
20−-if(NOT CMAKE_INSTALL_PREFIX STREQUAL "/usr")
21−- set(EXPORT_XCURSOR_PATH "XCURSOR_PATH=${KDE_INSTALL_FULL_DATAROOTDIR}/icons:$XCURSOR_PATH\":~/.icons:/usr/share/icons:/usr/share/pixmaps:/usr/X11R6/lib/X11/icons\"; export XCURSOR_PATH")
22−-endif()
23−-
24− configure_file(startkde.cmake ${CMAKE_CURRENT_BINARY_DIR}/startkde @ONLY)
25− configure_file(startplasmacompositor.cmake ${CMAKE_CURRENT_BINARY_DIR}/startplasmacompositor @ONLY)
26− configure_file(startplasma.cmake ${CMAKE_CURRENT_BINARY_DIR}/startplasma @ONLY)
27−diff --git a/startkde/kstartupconfig/kstartupconfig.cpp b/startkde/kstartupconfig/kstartupconfig.cpp
28−index 493218e..d507aa5 100644
29−--- a/startkde/kstartupconfig/kstartupconfig.cpp
30−+++ b/startkde/kstartupconfig/kstartupconfig.cpp
31−@@ -147,5 +147,5 @@ int main()
32− fclose( keys );
33− fclose( config );
34− doit:
35−- return system( "kdostartupconfig5" );
36−+ return system( NIXPKGS_KDOSTARTUPCONFIG5 );
37− }
38−diff --git a/startkde/startkde.cmake b/startkde/startkde.cmake
39−index b68f0c6..97a13a1 100644
40−--- a/startkde/startkde.cmake
41−+++ b/startkde/startkde.cmake
42−@@ -1,22 +1,31 @@
43− #!/bin/sh
44− #
45−-# DEFAULT Plasma STARTUP SCRIPT ( @PROJECT_VERSION@ )
46−+# NIXPKGS KDE STARTUP SCRIPT ( @PROJECT_VERSION@ )
47− #
48−
49−+if test "x$1" = x--failsafe; then
50−+ KDE_FAILSAFE=1 # General failsafe flag
51−+ KWIN_COMPOSE=N # Disable KWin's compositing
52−+ QT_XCB_FORCE_SOFTWARE_OPENGL=1
53−+ export KWIN_COMPOSE KDE_FAILSAFE QT_XCB_FORCE_SOFTWARE_OPENGL
54−+fi
55−+
56− # When the X server dies we get a HUP signal from xinit. We must ignore it
57− # because we still need to do some cleanup.
58− trap 'echo GOT SIGHUP' HUP
59−
60−-# Check if a Plasma session already is running and whether it's possible to connect to X
61−-kcheckrunning
62−+# we have to unset this for Darwin since it will screw up KDE's dynamic-loading
63−+unset DYLD_FORCE_FLAT_NAMESPACE
64−+
65−+# Check if a KDE session already is running and whether it's possible to connect to X
66−+@CMAKE_INSTALL_FULL_BINDIR@/kcheckrunning
67− kcheckrunning_result=$?
68−-if test $kcheckrunning_result -eq 0 ; then
69−- echo "Plasma seems to be already running on this display."
70−- xmessage -geometry 500x100 "Plasma seems to be already running on this display." > /dev/null 2>/dev/null
71−- exit 1
72−-elif test $kcheckrunning_result -eq 2 ; then
73−- echo "\$DISPLAY is not set or cannot connect to the X server."
74−- exit 1
75−+if [ $kcheckrunning_result -eq 0 ]; then
76−+ echo "KDE seems to be already running on this display."
77−+ exit 1
78−+elif [ $kcheckrunning_result -eq 2 ]; then
79−+ echo "\$DISPLAY is not set or cannot connect to the X server."
80−+ exit 1
81− fi
82−
83− # Boot sequence:
84−@@ -33,62 +42,143 @@ fi
85− #
86− # * Then ksmserver is started which takes control of the rest of the startup sequence
87−
88−-if [ ${XDG_CONFIG_HOME} ]; then
89−- configDir=$XDG_CONFIG_HOME;
90−-else
91−- configDir=${HOME}/.config; #this is the default, http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
92−+export XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}"
93−+@NIXPKGS_MKDIR@ -p "$XDG_CONFIG_HOME"
94−+
95−+# The KDE icon cache is supposed to update itself
96−+# automatically, but it uses the timestamp on the icon
97−+# theme directory as a trigger. Since in Nix the
98−+# timestamp is always the same, this doesn't work. So as
99−+# a workaround, nuke the icon cache on login. This isn't
100−+# perfect, since it may require logging out after
101−+# installing new applications to update the cache.
102−+# See http://lists-archives.org/kde-devel/26175-what-when-will-icon-cache-refresh.html
103−+rm -fv $HOME/.cache/icon-cache.kcache
104−+
105−+# xdg-desktop-settings generates this empty file but
106−+# it makes kbuildsyscoca5 fail silently. To fix this
107−+# remove that menu if it exists.
108−+rm -fv $HOME/.config/menus/applications-merged/xdg-desktop-menu-dummy.menu
109−+
110−+# Remove the kbuildsyscoca5 cache. It will be regenerated immediately after.
111−+# This is necessary for kbuildsyscoca5 to recognize that software that has been removed.
112−+rm -fv $HOME/.cache/ksycoca*
113−+
114−+# Qt writes a weird ‘libraryPath’ line to
115−+# ~/.config/Trolltech.conf that causes the KDE plugin
116−+# paths of previous KDE invocations to be searched.
117−+# Obviously using mismatching KDE libraries is potentially
118−+# disastrous, so here we nuke references to the Nix store
119−+# in Trolltech.conf. A better solution would be to stop
120−+# Qt from doing this wackiness in the first place.
121−+if [ -e $XDG_CONFIG_HOME/Trolltech.conf ]; then
122−+ @NIXPKGS_SED@ -e '/nix\\store\|nix\/store/ d' -i $XDG_CONFIG_HOME/Trolltech.conf
123− fi
124− sysConfigDirs=${XDG_CONFIG_DIRS:-/etc/xdg}
125−
126−-# We need to create config folder so we can write startupconfigkeys
127−-mkdir -p $configDir
128−+@NIXPKGS_KBUILDSYCOCA5@
129−+
130−+# Set the default GTK 2 theme
131−+gtkrc2="$HOME/.gtkrc-2.0"
132−+breeze_gtkrc2="/run/current-system/sw/share/themes/Breeze/gtk-2.0/gtkrc"
133−+if ! [ -e "$gtkrc2" ] && [ -e "$breeze_gtkrc2" ]; then
134−+ cat >"$gtkrc2" <<EOF
135−+# Default GTK+ 2 config for NixOS KDE 5
136−+include "$breeze_gtkrc2"
137−+style "user-font"
138−+{
139−+ font_name="Sans Serif Regular"
140−+}
141−+widget_class "*" style "user-font"
142−+gtk-font-name="Sans Serif Regular 10"
143−+gtk-theme-name="Breeze"
144−+gtk-icon-theme-name="breeze"
145−+gtk-fallback-icon-theme="hicolor"
146−+gtk-cursor-theme-name="breeze_cursors"
147−+gtk-toolbar-style=GTK_TOOLBAR_ICONS
148−+gtk-menu-images=1
149−+gtk-button-images=1
150−+EOF
151−+fi
152−+
153−+# Set the default GTK 3 theme
154−+gtk3_settings="$XDG_CONFIG_HOME/gtk-3.0/settings.ini"
155−+breeze_gtk3="/run/current-system/sw/share/themes/Breeze/gtk-3.0"
156−+if ! [ -e "$gtk3_settings" ] && [ -e "$breeze_gtk" ]; then
157−+ mkdir -p $(dirname "$gtk3_settings")
158−+ cat >"$gtk3_settings" <<EOF
159−+[Settings]
160−+gtk-font-name=Sans Serif Regular 10
161−+gtk-theme-name=Breeze
162−+gtk-icon-theme-name=breeze
163−+gtk-fallback-icon-theme=hicolor
164−+gtk-cursor-theme-name=breeze_cursors
165−+gtk-toolbar-style=GTK_TOOLBAR_ICONS
166−+gtk-menu-images=1
167−+gtk-button-images=1
168−+EOF
169−+fi
170−+
171−+kcminputrc="$XDG_CONFIG_HOME/kcminputrc"
172−+if ! [ -e "$kcminputrc" ]; then
173−+ cat >"$kcminputrc" <<EOF
174−+[Mouse]
175−+cursorTheme=breeze_cursors
176−+cursorSize=0
177−+EOF
178−+fi
179−
180− #This is basically setting defaults so we can use them with kstartupconfig5
181−-cat >$configDir/startupconfigkeys <<EOF
182−+cat >"$XDG_CONFIG_HOME/startupconfigkeys" <<EOF
183− kcminputrc Mouse cursorTheme 'breeze_cursors'
184− kcminputrc Mouse cursorSize ''
185−-ksplashrc KSplash Theme Breeze
186−+ksplashrc KSplash Theme org.kde.breeze.desktop
187− ksplashrc KSplash Engine KSplashQML
188− kdeglobals KScreen ScaleFactor ''
189− kdeglobals KScreen ScreenScaleFactors ''
190− kcmfonts General forceFontDPI 0
191−+kcmfonts General dontChangeAASettings true
192− EOF
193−
194− # preload the user's locale on first start
195−-plasmalocalerc=$configDir/plasma-localerc
196−-test -f $plasmalocalerc || {
197−-cat >$plasmalocalerc <<EOF
198−+plasmalocalerc="$XDG_CONFIG_HOME/plasma-localerc"
199−+if ! [ -f "$plasmalocalerc" ]; then
200−+ cat >"$plasmalocalerc" <<EOF
201− [Formats]
202− LANG=$LANG
203− EOF
204−-}
205−+fi
206−
207− # export LC_* variables set by kcmshell5 formats into environment
208− # so it can be picked up by QLocale and friends.
209−-exportformatssettings=$configDir/plasma-locale-settings.sh
210−-test -f $exportformatssettings && {
211−- . $exportformatssettings
212−-}
213−+exportformatssettings="$XDG_CONFIG_HOME/plasma-locale-settings.sh"
214−+if [ -r "$exportformatssettings" ]; then
215−+ . "$exportformatssettings"
216−+fi
217−
218− # Write a default kdeglobals file to set up the font
219−-kdeglobalsfile=$configDir/kdeglobals
220−-test -f $kdeglobalsfile || {
221−-cat >$kdeglobalsfile <<EOF
222−+kdeglobalsfile="$XDG_CONFIG_HOME/kdeglobals"
223−+if ! [ -f "$kdeglobalsfile" ]; then
224−+ cat >"$kdeglobalsfile" <<EOF
225− [General]
226−-XftAntialias=true
227−-XftHintStyle=hintmedium
228−-XftSubPixel=none
229−+fixed=Monospace,10,-1,5,50,0,0,0,0,0,Regular
230−+font=Sans Serif,10,-1,5,50,0,0,0,0,0,Regular
231−+menuFont=Sans Serif,10,-1,5,50,0,0,0,0,0,Regular
232−+smallestReadableFont=Sans Serif,8,-1,5,50,0,0,0,0,0,Regular
233−+toolBarFont=Sans Serif,8,-1,5,50,0,0,0,0,0,Regular
234−+
235−+[WM]
236−+activeFont=Noto Sans,12,-1,5,50,0,0,0,0,0,Bold
237− EOF
238−-}
239−+fi
240−
241−-kstartupconfig5
242−-returncode=$?
243−-if test $returncode -ne 0; then
244−- xmessage -geometry 500x100 "kstartupconfig5 does not exist or fails. The error code is $returncode. Check your installation."
245−+if ! @CMAKE_INSTALL_FULL_BINDIR@/kstartupconfig5; then
246−+ echo "kstartupconfig5 does not exist or fails. The error code is $returncode. Check your installation." 1>&2
247− exit 1
248− fi
249−-[ -r $configDir/startupconfig ] && . $configDir/startupconfig
250−-
251−+if [ -r "$XDG_CONFIG_HOME/startupconfig" ]; then
252−+ . "$XDG_CONFIG_HOME/startupconfig"
253−+fi
254−
255− #Do not sync any of this section with the wayland versions as there scale factors are
256− #sent properly over wl_output
257−@@ -104,26 +194,33 @@ fi
258− #otherwise apps that manually opt in for high DPI get auto scaled by the developer AND manually scaled by us
259− export QT_AUTO_SCREEN_SCALE_FACTOR=0
260−
261−+#Set the QtQuickControls style to our own: for QtQuickControls1
262−+#it will fall back to Desktop, while it will use our own org.kde.desktop
263−+#for QtQuickControlsStyle and Kirigami
264−+export QT_QUICK_CONTROLS_STYLE=org.kde.desktop
265−+
266−+XCURSOR_PATH=~/.icons
267−+IFS=":" read -r -a xdgDirs <<< "$XDG_DATA_DIRS"
268−+for xdgDir in "${xdgDirs[@]}"; do
269−+ XCURSOR_PATH="$XCURSOR_PATH:$xdgDir/icons"
270−+done
271−+export XCURSOR_PATH
272−+
273− # XCursor mouse theme needs to be applied here to work even for kded or ksmserver
274− if test -n "$kcminputrc_mouse_cursortheme" -o -n "$kcminputrc_mouse_cursorsize" ; then
275−- @EXPORT_XCURSOR_PATH@
276−-
277− kapplymousetheme "$kcminputrc_mouse_cursortheme" "$kcminputrc_mouse_cursorsize"
278−- if test $? -eq 10; then
279−- XCURSOR_THEME=breeze_cursors
280−- export XCURSOR_THEME
281−- elif test -n "$kcminputrc_mouse_cursortheme"; then
282−- XCURSOR_THEME="$kcminputrc_mouse_cursortheme"
283−- export XCURSOR_THEME
284−+ if [ $? -eq 10 ]; then
285−+ export XCURSOR_THEME=breeze_cursors
286−+ elif [ -n "$kcminputrc_mouse_cursortheme" ]; then
287−+ export XCURSOR_THEME="$kcminputrc_mouse_cursortheme"
288− fi
289−- if test -n "$kcminputrc_mouse_cursorsize"; then
290−- XCURSOR_SIZE="$kcminputrc_mouse_cursorsize"
291−- export XCURSOR_SIZE
292−+ if [ -n "$kcminputrc_mouse_cursorsize" ]; then
293−+ export XCURSOR_SIZE="$kcminputrc_mouse_cursorsize"
294− fi
295− fi
296−
297−-if test "$kcmfonts_general_forcefontdpi" -ne 0; then
298−- xrdb -quiet -merge -nocpp <<EOF
299−+if [ "${kcmfonts_general_forcefontdpi:-0}" -ne 0 ]; then
300−+ @NIXPKGS_XRDB@ -quiet -merge -nocpp <<EOF
301− Xft.dpi: $kcmfonts_general_forcefontdpi
302− EOF
303− fi
304−@@ -132,11 +229,11 @@ dl=$DESKTOP_LOCKED
305− unset DESKTOP_LOCKED # Don't want it in the environment
306−
307− ksplash_pid=
308−-if test -z "$dl"; then
309−+if [ -z "$dl" ]; then
310− # the splashscreen and progress indicator
311− case "$ksplashrc_ksplash_engine" in
312− KSplashQML)
313−- ksplash_pid=`ksplashqml "${ksplashrc_ksplash_theme}" --pid`
314−+ ksplash_pid=$(@CMAKE_INSTALL_FULL_BINDIR@/ksplashqml "${ksplashrc_ksplash_theme}" --pid)
315− ;;
316− None)
317− ;;
318−@@ -145,27 +242,6 @@ if test -z "$dl"; then
319− esac
320− fi
321−
322−-# Source scripts found in <config locations>/plasma-workspace/env/*.sh
323−-# (where <config locations> correspond to the system and user's configuration
324−-# directory.
325−-#
326−-# This is where you can define environment variables that will be available to
327−-# all KDE programs, so this is where you can run agents using e.g. eval `ssh-agent`
328−-# or eval `gpg-agent --daemon`.
329−-# Note: if you do that, you should also put "ssh-agent -k" as a shutdown script
330−-#
331−-# (see end of this file).
332−-# For anything else (that doesn't set env vars, or that needs a window manager),
333−-# better use the Autostart folder.
334−-
335−-scriptpath=`echo "$configDir:$sysConfigDirs" | tr ':' '\n'`
336−-
337−-for prefix in `echo $scriptpath`; do
338−- for file in "$prefix"/plasma-workspace/env/*.sh; do
339−- test -r "$file" && . "$file" || true
340−- done
341−-done
342−-
343− # Set a left cursor instead of the standard X11 "X" cursor, since I've heard
344− # from some users that they're confused and don't know what to do. This is
345− # especially necessary on slow machines, where starting KDE takes one or two
346−@@ -221,44 +297,65 @@ export XDG_DATA_DIRS
347− #
348− KDE_FULL_SESSION=true
349− export KDE_FULL_SESSION
350−-xprop -root -f KDE_FULL_SESSION 8t -set KDE_FULL_SESSION true
351−+@NIXPKGS_XPROP@ -root -f KDE_FULL_SESSION 8t -set KDE_FULL_SESSION true
352−
353− KDE_SESSION_VERSION=5
354− export KDE_SESSION_VERSION
355−-xprop -root -f KDE_SESSION_VERSION 32c -set KDE_SESSION_VERSION 5
356−+@NIXPKGS_XPROP@ -root -f KDE_SESSION_VERSION 32c -set KDE_SESSION_VERSION 5
357−
358−-KDE_SESSION_UID=`id -ru`
359−+KDE_SESSION_UID=$(@NIXPKGS_ID@ -ru)
360− export KDE_SESSION_UID
361−
362− XDG_CURRENT_DESKTOP=KDE
363− export XDG_CURRENT_DESKTOP
364−
365−+# Enforce xcb QPA. Helps switching between Wayland and X sessions.
366−+export QT_QPA_PLATFORM=xcb
367−+
368−+# Source scripts found in <config locations>/plasma-workspace/env/*.sh
369−+# (where <config locations> correspond to the system and user's configuration
370−+# directories, as identified by Qt's qtpaths, e.g. $HOME/.config
371−+# and /etc/xdg/ on Linux)
372−+#
373−+# This is where you can define environment variables that will be available to
374−+# all KDE programs, so this is where you can run agents using e.g. eval `ssh-agent`
375−+# or eval `gpg-agent --daemon`.
376−+# Note: if you do that, you should also put "ssh-agent -k" as a shutdown script
377−+#
378−+# (see end of this file).
379−+# For anything else (that doesn't set env vars, or that needs a window manager),
380−+# better use the Autostart folder.
381−+
382−+IFS=":" read -r -a scriptpath <<< $(@NIXPKGS_QTPATHS@ --paths GenericConfigLocation)
383−+# Add /env/ to the directory to locate the scripts to be sourced
384−+for prefix in "${scriptpath[@]}"; do
385−+ for file in "$prefix"/plasma-workspace/env/*.sh; do
386−+ if [ -r "$file" ]; then
387−+ . "$file"
388−+ fi
389−+ done
390−+done
391−+
392− # At this point all environment variables are set, let's send it to the DBus session server to update the activation environment
393−-if which dbus-update-activation-environment >/dev/null 2>/dev/null ; then
394−- dbus-update-activation-environment --systemd --all
395−-else
396−- @CMAKE_INSTALL_FULL_LIBEXECDIR@/ksyncdbusenv
397−-fi
398−-if test $? -ne 0; then
399−+
400−+if ! @NIXPKGS_DBUS_UPDATE_ACTIVATION_ENVIRONMENT@ --systemd --all; then
401− # Startup error
402− echo 'startkde: Could not sync environment to dbus.' 1>&2
403− test -n "$ksplash_pid" && kill "$ksplash_pid" 2>/dev/null
404−- xmessage -geometry 500x100 "Could not sync environment to dbus."
405− exit 1
406− fi
407−
408− # We set LD_BIND_NOW to increase the efficiency of kdeinit.
409− # kdeinit unsets this variable before loading applications.
410−-LD_BIND_NOW=true @CMAKE_INSTALL_FULL_LIBEXECDIR_KF5@/start_kdeinit_wrapper --kded +kcminit_startup
411−+LD_BIND_NOW=true @NIXPKGS_START_KDEINIT_WRAPPER@ --kded +kcminit_startup
412− if test $? -ne 0; then
413− # Startup error
414− echo 'startkde: Could not start kdeinit5. Check your installation.' 1>&2
415− test -n "$ksplash_pid" && kill "$ksplash_pid" 2>/dev/null
416−- xmessage -geometry 500x100 "Could not start kdeinit5. Check your installation."
417− exit 1
418− fi
419−
420−-qdbus org.kde.KSplash /KSplash org.kde.KSplash.setStage kinit &
421−+@NIXPKGS_QDBUS@ org.kde.KSplash /KSplash org.kde.KSplash.setStage kinit &
422−
423− # finally, give the session control to the session manager
424− # see kdebase/ksmserver for the description of the rest of the startup sequence
425−@@ -270,12 +367,16 @@ qdbus org.kde.KSplash /KSplash org.kde.KSplash.setStage kinit &
426− # We only check for 255 which means that the ksmserver process could not be
427− # started, any problems thereafter, e.g. ksmserver failing to initialize,
428− # will remain undetected.
429−-test -n "$KDEWM" && KDEWM="--windowmanager $KDEWM"
430−+if [ -n "$KDEWM" ]; then
431−+ KDEWM="--windowmanager $KDEWM"
432−+fi
433− # If the session should be locked from the start (locked autologin),
434− # lock now and do the rest of the KDE startup underneath the locker.
435− KSMSERVEROPTIONS=""
436−-test -n "$dl" && KSMSERVEROPTIONS=" --lockscreen"
437−-kwrapper5 @CMAKE_INSTALL_FULL_BINDIR@/ksmserver $KDEWM $KSMSERVEROPTIONS
438−+if [ -n "$dl" ]; then
439−+ KSMSERVEROPTIONS=" --lockscreen"
440−+fi
441−+@NIXPKGS_KWRAPPER5@ @CMAKE_INSTALL_FULL_BINDIR@/ksmserver $KDEWM $KSMSERVEROPTIONS
442− if test $? -eq 255; then
443− # Startup error
444− echo 'startkde: Could not start ksmserver. Check your installation.' 1>&2
445−@@ -286,19 +387,19 @@ fi
446− #Anything after here is logout
447− #It is not called after shutdown/restart
448−
449−-wait_drkonqi=`kreadconfig5 --file startkderc --group WaitForDrKonqi --key Enabled --default true`
450−+wait_drkonqi=$(@NIXPKGS_KREADCONFIG5@ --file startkderc --group WaitForDrKonqi --key Enabled --default true)
451−
452−-if test x"$wait_drkonqi"x = x"true"x ; then
453−+if [ x"$wait_drkonqi"x = x"true"x ]; then
454− # wait for remaining drkonqi instances with timeout (in seconds)
455−- wait_drkonqi_timeout=`kreadconfig5 --file startkderc --group WaitForDrKonqi --key Timeout --default 900`
456−+ wait_drkonqi_timeout=$(@NIXPKGS_KREADCONFIG5@ --file startkderc --group WaitForDrKonqi --key Timeout --default 900)
457− wait_drkonqi_counter=0
458−- while qdbus | grep "^[^w]*org.kde.drkonqi" > /dev/null ; do
459−+ while @NIXPKGS_QDBUS@ | @NIXPKGS_GREP@ -q "^[^w]*org.kde.drkonqi" ; do
460− sleep 5
461− wait_drkonqi_counter=$((wait_drkonqi_counter+5))
462−- if test "$wait_drkonqi_counter" -ge "$wait_drkonqi_timeout" ; then
463−+ if [ "$wait_drkonqi_counter" -ge "$wait_drkonqi_timeout" ]; then
464− # ask remaining drkonqis to die in a graceful way
465−- qdbus | grep 'org.kde.drkonqi-' | while read address ; do
466−- qdbus "$address" "/MainApplication" "quit"
467−+ @NIXPKGS_QDBUS@ | @NIXPKGS_GREP@ 'org.kde.drkonqi-' | while read address ; do
468−+ @NIXPKGS_QDBUS@ "$address" "/MainApplication" "quit"
469− done
470− break
471− fi
472−@@ -307,15 +408,17 @@ fi
473−
474− echo 'startkde: Shutting down...' 1>&2
475− # just in case
476−-test -n "$ksplash_pid" && kill "$ksplash_pid" 2>/dev/null
477−+if [ -n "$ksplash_pid" ]; then
478−+ kill "$ksplash_pid" 2>/dev/null
479−+fi
480−
481− # Clean up
482−-kdeinit5_shutdown
483−+@NIXPKGS_KDEINIT5_SHUTDOWN@
484−
485− unset KDE_FULL_SESSION
486−-xprop -root -remove KDE_FULL_SESSION
487−+@NIXPKGS_XPROP@ -root -remove KDE_FULL_SESSION
488− unset KDE_SESSION_VERSION
489−-xprop -root -remove KDE_SESSION_VERSION
490−+@NIXPKGS_XPROP@ -root -remove KDE_SESSION_VERSION
491− unset KDE_SESSION_UID
492−
493− echo 'startkde: Done.' 1>&2
494−diff --git a/startkde/startplasma.cmake b/startkde/startplasma.cmake
495−index 1fe41c5..11757df 100644
496−--- a/startkde/startplasma.cmake
497−+++ b/startkde/startplasma.cmake
498−@@ -1,6 +1,6 @@
499− #!/bin/sh
500− #
501−-# DEFAULT Plasma STARTUP SCRIPT ( @PROJECT_VERSION@ )
502−+# NIXPKGS Plasma STARTUP SCRIPT ( @PROJECT_VERSION@ )
503− #
504−
505− # Boot sequence:
506−@@ -17,28 +17,26 @@
507− #
508− # * Then ksmserver is started which takes control of the rest of the startup sequence
509−
510−-# We need to create config folder so we can write startupconfigkeys
511−-if [ ${XDG_CONFIG_HOME} ]; then
512−- configDir=$XDG_CONFIG_HOME;
513−-else
514−- configDir=${HOME}/.config; #this is the default, http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
515−+export XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}"
516−+if [ -r "$XDG_CONFIG_HOME/startupconfig" ]; then
517−+ . "$XDG_CONFIG_HOME/startupconfig"
518− fi
519−
520−-[ -r $configDir/startupconfig ] && . $configDir/startupconfig
521−-
522−-xrdb -quiet -merge -nocpp <<EOF
523−+if [ "$kcmfonts_general_forcefontdpi" -ne 0 ]; then
524−+ @NIXPKGS_XRDB@ -quiet -merge -nocpp <<EOF
525− Xft.dpi: $QT_WAYLAND_FORCE_DPI
526− EOF
527−+fi
528−
529− dl=$DESKTOP_LOCKED
530− unset DESKTOP_LOCKED # Don't want it in the environment
531−
532− ksplash_pid=
533−-if test -z "$dl"; then
534−+if [ -z "$dl" ]; then
535− # the splashscreen and progress indicator
536− case "$ksplashrc_ksplash_engine" in
537− KSplashQML)
538−- ksplash_pid=`ksplashqml "${ksplashrc_ksplash_theme}" --pid`
539−+ ksplash_pid=$(@CMAKE_INSTALL_FULL_BINDIR@/ksplashqml "${ksplashrc_ksplash_theme}" --pid)
540− ;;
541− None)
542− ;;
543−@@ -58,23 +56,13 @@ export PLASMA_USE_QT_SCALING=1
544− # If the user has overwritten fonts, the cursor font may be different now
545− # so don't move this up.
546− #
547−-xsetroot -cursor_name left_ptr
548−-
549−-# Get Ghostscript to look into user's KDE fonts dir for additional Fontmap
550−-usr_fdir=$HOME/.fonts
551−-if test -n "$GS_LIB" ; then
552−- GS_LIB=$usr_fdir:$GS_LIB
553−- export GS_LIB
554−-else
555−- GS_LIB=$usr_fdir
556−- export GS_LIB
557−-fi
558−+@NIXPKGS_XSETROOT@ -cursor_name left_ptr
559−
560− echo 'startplasma: Starting up...' 1>&2
561−
562− # export our session variables to the Xwayland server
563−-xprop -root -f KDE_FULL_SESSION 8t -set KDE_FULL_SESSION true
564−-xprop -root -f KDE_SESSION_VERSION 32c -set KDE_SESSION_VERSION 5
565−+@NIXPKGS_XPROP@ -root -f KDE_FULL_SESSION 8t -set KDE_FULL_SESSION true
566−+@NIXPKGS_XPROP@ -root -f KDE_SESSION_VERSION 32c -set KDE_SESSION_VERSION 5
567−
568− # At this point all environment variables are set, let's send it to the DBus session server to update the activation environment
569− if which dbus-update-activation-environment >/dev/null 2>/dev/null ; then
570−@@ -90,16 +78,15 @@ fi
571−
572− # We set LD_BIND_NOW to increase the efficiency of kdeinit.
573− # kdeinit unsets this variable before loading applications.
574−-LD_BIND_NOW=true @CMAKE_INSTALL_FULL_LIBEXECDIR_KF5@/start_kdeinit_wrapper --kded +kcminit_startup
575−+LD_BIND_NOW=true @NIXPKGS_START_KDEINIT_WRAPPER@ --kded +kcminit_startup
576− if test $? -ne 0; then
577− # Startup error
578− echo 'startplasma: Could not start kdeinit5. Check your installation.' 1>&2
579− test -n "$ksplash_pid" && kill "$ksplash_pid" 2>/dev/null
580−- xmessage -geometry 500x100 "Could not start kdeinit5. Check your installation."
581− exit 1
582− fi
583−
584−-qdbus org.kde.KSplash /KSplash org.kde.KSplash.setStage kinit &
585−+@NIXPKGS_QDBUS@ org.kde.KSplash /KSplash org.kde.KSplash.setStage kinit &
586−
587− # finally, give the session control to the session manager
588− # see kdebase/ksmserver for the description of the rest of the startup sequence
589−@@ -125,19 +112,19 @@ fi
590− #Anything after here is logout
591− #It is not called after shutdown/restart
592−
593−-wait_drkonqi=`kreadconfig5 --file startkderc --group WaitForDrKonqi --key Enabled --default true`
594−+wait_drkonqi=$(@NIXPKGS_KREADCONFIG5@ --file startkderc --group WaitForDrKonqi --key Enabled --default true)
595−
596−-if test x"$wait_drkonqi"x = x"true"x ; then
597−+if [ x"$wait_drkonqi"x = x"true"x ]; then
598− # wait for remaining drkonqi instances with timeout (in seconds)
599−- wait_drkonqi_timeout=`kreadconfig5 --file startkderc --group WaitForDrKonqi --key Timeout --default 900`
600−+ wait_drkonqi_timeout=$(@NIXPKGS_KREADCONFIG5@ --file startkderc --group WaitForDrKonqi --key Timeout --default 900)
601− wait_drkonqi_counter=0
602−- while qdbus | grep "^[^w]*org.kde.drkonqi" > /dev/null ; do
603−+ while @NIXPKGS_QDBUS@ | @NIXPKGS_GREP@ -q "^[^w]*org.kde.drkonqi" ; do
604− sleep 5
605− wait_drkonqi_counter=$((wait_drkonqi_counter+5))
606−- if test "$wait_drkonqi_counter" -ge "$wait_drkonqi_timeout" ; then
607−+ if [ "$wait_drkonqi_counter" -ge "$wait_drkonqi_timeout" ]; then
608− # ask remaining drkonqis to die in a graceful way
609−- qdbus | grep 'org.kde.drkonqi-' | while read address ; do
610−- qdbus "$address" "/MainApplication" "quit"
611−+ @NIXPKGS_QDBUS@ | @NIXPKGS_GREP@ 'org.kde.drkonqi-' | while read address ; do
612−+ @NIXPKGS_QDBUS@ "$address" "/MainApplication" "quit"
613− done
614− break
615− fi
616−@@ -146,15 +133,17 @@ fi
617−
618− echo 'startplasma: Shutting down...' 1>&2
619− # just in case
620−-test -n "$ksplash_pid" && kill "$ksplash_pid" 2>/dev/null
621−+if [ -n "$ksplash_pid" ]; then
622−+ "$ksplash_pid" 2>/dev/null
623−+fi
624−
625− # Clean up
626−-kdeinit5_shutdown
627−+@NIXPKGS_KDEINIT5_SHUTDOWN@
628−
629− unset KDE_FULL_SESSION
630−-xprop -root -remove KDE_FULL_SESSION
631−+@NIXPKGS_XPROP@ -root -remove KDE_FULL_SESSION
632− unset KDE_SESSION_VERSION
633−-xprop -root -remove KDE_SESSION_VERSION
634−+@NIXPKGS_XPROP@ -root -remove KDE_SESSION_VERSION
635− unset KDE_SESSION_UID
636−
637− echo 'startplasma: Done.' 1>&2
638−diff --git a/startkde/startplasmacompositor.cmake b/startkde/startplasmacompositor.cmake
639−index dcb473a..0988740 100644
640−--- a/startkde/startplasmacompositor.cmake
641−+++ b/startkde/startplasmacompositor.cmake
642−@@ -1,118 +1,174 @@
643− #!/bin/sh
644− #
645−-# DEFAULT Plasma STARTUP SCRIPT ( @PROJECT_VERSION@ )
646−+# NIXPKGS Plasma STARTUP SCRIPT ( @PROJECT_VERSION@ )
647− #
648−
649−-# We need to create config folder so we can write startupconfigkeys
650−-if [ ${XDG_CONFIG_HOME} ]; then
651−- configDir=$XDG_CONFIG_HOME;
652−-else
653−- configDir=${HOME}/.config; #this is the default, http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
654−+# we have to unset this for Darwin since it will screw up KDE's dynamic-loading
655−+unset DYLD_FORCE_FLAT_NAMESPACE
656−+
657−+export XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}"
658−+@NIXPKGS_MKDIR@ -p "$XDG_CONFIG_HOME"
659−+
660−+# The KDE icon cache is supposed to update itself
661−+# automatically, but it uses the timestamp on the icon
662−+# theme directory as a trigger. Since in Nix the
663−+# timestamp is always the same, this doesn't work. So as
664−+# a workaround, nuke the icon cache on login. This isn't
665−+# perfect, since it may require logging out after
666−+# installing new applications to update the cache.
667−+# See http://lists-archives.org/kde-devel/26175-what-when-will-icon-cache-refresh.html
668−+rm -fv $HOME/.cache/icon-cache.kcache
669−+
670−+# xdg-desktop-settings generates this empty file but
671−+# it makes kbuildsyscoca5 fail silently. To fix this
672−+# remove that menu if it exists.
673−+rm -fv $HOME/.config/menus/applications-merged/xdg-desktop-menu-dummy.menu
674−+
675−+# Remove the kbuildsyscoca5 cache. It will be regenerated immediately after.
676−+# This is necessary for kbuildsyscoca5 to recognize that software that has been removed.
677−+rm -fv $HOME/.cache/ksycoca*
678−+
679−+# Qt writes a weird ‘libraryPath’ line to
680−+# ~/.config/Trolltech.conf that causes the KDE plugin
681−+# paths of previous KDE invocations to be searched.
682−+# Obviously using mismatching KDE libraries is potentially
683−+# disastrous, so here we nuke references to the Nix store
684−+# in Trolltech.conf. A better solution would be to stop
685−+# Qt from doing this wackiness in the first place.
686−+if [ -e $XDG_CONFIG_HOME/Trolltech.conf ]; then
687−+ @NIXPKGS_SED@ -e '/nix\\store\|nix\/store/ d' -i $XDG_CONFIG_HOME/Trolltech.conf
688−+fi
689−+
690−+@NIXPKGS_KBUILDSYCOCA5@
691−+
692−+# Set the default GTK 2 theme
693−+gtkrc2="$HOME/.gtkrc-2.0"
694−+breeze_gtkrc2="/run/current-system/sw/share/themes/Breeze/gtk-2.0/gtkrc"
695−+if ! [ -e "$gtkrc2" ] && [ -e "$breeze_gtkrc2" ]; then
696−+ cat >"$gtkrc2" <<EOF
697−+# Default GTK+ 2 config for NixOS KDE 5
698−+include "$breeze_gtkrc2"
699−+style "user-font"
700−+{
701−+ font_name="Sans Serif Regular"
702−+}
703−+widget_class "*" style "user-font"
704−+gtk-font-name="Sans Serif Regular 10"
705−+gtk-theme-name="Breeze"
706−+gtk-icon-theme-name="breeze"
707−+gtk-fallback-icon-theme="hicolor"
708−+gtk-cursor-theme-name="breeze_cursors"
709−+gtk-toolbar-style=GTK_TOOLBAR_ICONS
710−+gtk-menu-images=1
711−+gtk-button-images=1
712−+EOF
713− fi
714− sysConfigDirs=${XDG_CONFIG_DIRS:-/etc/xdg}
715−
716−-# We need to create config folder so we can write startupconfigkeys
717−-mkdir -p $configDir
718−+# Set the default GTK 3 theme
719−+gtk3_settings="$XDG_CONFIG_HOME/gtk-3.0/settings.ini"
720−+breeze_gtk3="/run/current-system/sw/share/themes/Breeze/gtk-3.0"
721−+if ! [ -e "$gtk3_settings" ] && [ -e "$breeze_gtk" ]; then
722−+ mkdir -p $(dirname "$gtk3_settings")
723−+ cat >"$gtk3_settings" <<EOF
724−+[Settings]
725−+gtk-font-name=Sans Serif Regular 10
726−+gtk-theme-name=Breeze
727−+gtk-icon-theme-name=breeze
728−+gtk-fallback-icon-theme=hicolor
729−+gtk-cursor-theme-name=breeze_cursors
730−+gtk-toolbar-style=GTK_TOOLBAR_ICONS
731−+gtk-menu-images=1
732−+gtk-button-images=1
733−+EOF
734−+fi
735−+
736−+kcminputrc="$XDG_CONFIG_HOME/kcminputrc"
737−+if ! [ -e "$kcminputrc" ]; then
738−+ cat >"$kcminputrc" <<EOF
739−+[Mouse]
740−+cursorTheme=breeze_cursors
741−+cursorSize=0
742−+EOF
743−+fi
744−
745− #This is basically setting defaults so we can use them with kstartupconfig5
746−-cat >$configDir/startupconfigkeys <<EOF
747−+cat >"$XDG_CONFIG_HOME/startupconfigkeys" <<EOF
748− kcminputrc Mouse cursorTheme 'breeze_cursors'
749− kcminputrc Mouse cursorSize ''
750−-ksplashrc KSplash Theme Breeze
751−+ksplashrc KSplash Theme org.kde.breeze.desktop
752− ksplashrc KSplash Engine KSplashQML
753−-kcmfonts General forceFontDPIWayland 0
754−+kdeglobals KScreen ScreenScaleFactors ''
755−+kcmfonts General forceFontDPI 0
756−+kcmfonts General dontChangeAASettings true
757− EOF
758−
759− # preload the user's locale on first start
760−-plasmalocalerc=$configDir/plasma-localerc
761−-test -f $plasmalocalerc || {
762−-cat >$plasmalocalerc <<EOF
763−+plasmalocalerc="$XDG_CONFIG_HOME/plasma-localerc"
764−+if ! [ -f "$plasmalocalerc" ]; then
765−+ cat >"$plasmalocalerc" <<EOF
766− [Formats]
767− LANG=$LANG
768− EOF
769−-}
770−+fi
771−
772− # export LC_* variables set by kcmshell5 formats into environment
773− # so it can be picked up by QLocale and friends.
774−-exportformatssettings=$configDir/plasma-locale-settings.sh
775−-test -f $exportformatssettings && {
776−- . $exportformatssettings
777−-}
778−+exportformatssettings="$XDG_CONFIG_HOME/plasma-locale-settings.sh"
779−+if [ -r "$exportformatssettings" ]; then
780−+ . "$exportformatssettings"
781−+fi
782−
783− # Write a default kdeglobals file to set up the font
784−-kdeglobalsfile=$configDir/kdeglobals
785−-test -f $kdeglobalsfile || {
786−-cat >$kdeglobalsfile <<EOF
787−+kdeglobalsfile="$XDG_CONFIG_HOME/kdeglobals"
788−+if ! [ -f "$kdeglobalsfile" ]; then
789−+ cat >"$kdeglobalsfile" <<EOF
790− [General]
791−-XftAntialias=true
792−-XftHintStyle=hintmedium
793−-XftSubPixel=none
794−+fixed=Monospace,10,-1,5,50,0,0,0,0,0,Regular
795−+font=Sans Serif,10,-1,5,50,0,0,0,0,0,Regular
796−+menuFont=Sans Serif,10,-1,5,50,0,0,0,0,0,Regular
797−+smallestReadableFont=Sans Serif,8,-1,5,50,0,0,0,0,0,Regular
798−+toolBarFont=Sans Serif,8,-1,5,50,0,0,0,0,0,Regular
799−+
800−+[WM]
801−+activeFont=Noto Sans,12,-1,5,50,0,0,0,0,0,Bold
802− EOF
803−-}
804−-
805−-# Make sure the Oxygen font is installed
806−-# This is necessary for setups where CMAKE_INSTALL_PREFIX
807−-# is not in /usr. fontconfig looks in /usr, ~/.fonts and
808−-# $XDG_DATA_HOME for fonts. In this case, we symlink the
809−-# Oxygen font under ${XDG_DATA_HOME} and make it known to
810−-# fontconfig
811−-
812−-usr_share="/usr/share"
813−-install_share="@KDE_INSTALL_FULL_DATADIR@"
814−-
815−-if [ ! $install_share = $usr_share ]; then
816−-
817−- if [ ${XDG_DATA_HOME} ]; then
818−- fontsDir="${XDG_DATA_HOME}/fonts"
819−- else
820−- fontsDir="${HOME}/.fonts"
821−- fi
822−-
823−- test -d $fontsDir || {
824−- mkdir -p $fontsDir
825−- }
826−-
827−- oxygenDir=$fontsDir/truetype/oxygen
828−- prefixDir="@KDE_INSTALL_FULL_DATADIR@/fonts/truetype/oxygen"
829−-
830−- # if the oxygen dir doesn't exist, create a symlink to be sure that the
831−- # Oxygen font is available to the user
832−- test -d $oxygenDir || test -d $prefixDir && {
833−- test -h $oxygenDir || ln -s $prefixDir $oxygenDir && fc-cache $oxygenDir
834−- }
835− fi
836−
837−-kstartupconfig5
838−+@CMAKE_INSTALL_FULL_BINDIR@/kstartupconfig5
839− returncode=$?
840− if test $returncode -ne 0; then
841− exit 1
842− fi
843−-[ -r $configDir/startupconfig ] && . $configDir/startupconfig
844−+if [ -r "$XDG_CONFIG_HOME/startupconfig" ]; then
845−+ . "$XDG_CONFIG_HOME/startupconfig"
846−+fi
847−
848− #Manually disable auto scaling because we are scaling above
849− #otherwise apps that manually opt in for high DPI get auto scaled by the developer AND scaled by the wl_output
850− export QT_AUTO_SCREEN_SCALE_FACTOR=0
851−
852−-# XCursor mouse theme needs to be applied here to work even for kded or ksmserver
853−-if test -n "$kcminputrc_mouse_cursortheme" -o -n "$kcminputrc_mouse_cursorsize" ; then
854−- @EXPORT_XCURSOR_PATH@
855−+XCURSOR_PATH=~/.icons
856−+IFS=":" read -r -a xdgDirs <<< "$XDG_DATA_DIRS"
857−+for xdgDir in "${xdgDirs[@]}"; do
858−+ XCURSOR_PATH="$XCURSOR_PATH:$xdgDir/icons"
859−+done
860−+export XCURSOR_PATH
861−
862−- # TODO: is kapplymousetheme a core app?
863−+# XCursor mouse theme needs to be applied here to work even for kded or ksmserver
864−+if [ -n "$kcminputrc_mouse_cursortheme" -o -n "$kcminputrc_mouse_cursorsize" ]; then
865− #kapplymousetheme "$kcminputrc_mouse_cursortheme" "$kcminputrc_mouse_cursorsize"
866−- if test $? -eq 10; then
867−- XCURSOR_THEME=breeze_cursors
868−- export XCURSOR_THEME
869−- elif test -n "$kcminputrc_mouse_cursortheme"; then
870−- XCURSOR_THEME="$kcminputrc_mouse_cursortheme"
871−- export XCURSOR_THEME
872−+ if [ $? -eq 10 ]; then
873−+ export XCURSOR_THEME=breeze_cursors
874−+ elif [ -n "$kcminputrc_mouse_cursortheme" ]; then
875−+ export XCURSOR_THEME="$kcminputrc_mouse_cursortheme"
876− fi
877−- if test -n "$kcminputrc_mouse_cursorsize"; then
878−- XCURSOR_SIZE="$kcminputrc_mouse_cursorsize"
879−- export XCURSOR_SIZE
880−+ if [ -n "$kcminputrc_mouse_cursorsize" ]; then
881−+ export XCURSOR_SIZE="$kcminputrc_mouse_cursorsize"
882− fi
883− fi
884−
885−-if test "$kcmfonts_general_forcefontdpiwayland" -ne 0; then
886−+if [ "${kcmfonts_general_forcefontdpiwayland:-0}" -ne 0 ]; then
887− export QT_WAYLAND_FORCE_DPI=$kcmfonts_general_forcefontdpiwayland
888− else
889− export QT_WAYLAND_FORCE_DPI=96
890−@@ -120,12 +176,12 @@ fi
891−
892− # Get a property value from org.freedesktop.locale1
893− queryLocale1() {
894−- qdbus --system org.freedesktop.locale1 /org/freedesktop/locale1 "$1"
895−+ @NIXPKGS_QDBUS@ --system org.freedesktop.locale1 /org/freedesktop/locale1 "$1"
896− }
897−
898− # Query whether org.freedesktop.locale1 is available. If it is, try to
899− # set XKB_DEFAULT_{MODEL,LAYOUT,VARIANT,OPTIONS} accordingly.
900−-if qdbus --system org.freedesktop.locale1 >/dev/null 2>/dev/null; then
901−+if @NIXPKGS_QDBUS@ --system org.freedesktop.locale1 >/dev/null 2>/dev/null; then
902− # Do not overwrite existing values. There is no point in setting only some
903− # of them as then they would not match anymore.
904− if [ -z "${XKB_DEFAULT_MODEL}" -a -z "${XKB_DEFAULT_LAYOUT}" -a \
905−@@ -141,41 +197,10 @@ if qdbus --system org.freedesktop.locale1 >/dev/null 2>/dev/null; then
906− fi
907− fi
908−
909−-# Source scripts found in <config locations>/plasma-workspace/env/*.sh
910−-# (where <config locations> correspond to the system and user's configuration
911−-# directories, as identified by Qt's qtpaths, e.g. $HOME/.config
912−-# and /etc/xdg/ on Linux)
913−-#
914−-# This is where you can define environment variables that will be available to
915−-# all KDE programs, so this is where you can run agents using e.g. eval `ssh-agent`
916−-# or eval `gpg-agent --daemon`.
917−-# Note: if you do that, you should also put "ssh-agent -k" as a shutdown script
918−-#
919−-# (see end of this file).
920−-# For anything else (that doesn't set env vars, or that needs a window manager),
921−-# better use the Autostart folder.
922−-
923−-scriptpath=`echo "$configDir:$sysConfigDirs" | tr ':' '\n'`
924−-
925−-for prefix in `echo $scriptpath`; do
926−- for file in "$prefix"/plasma-workspace/env/*.sh; do
927−- test -r "$file" && . "$file" || true
928−- done
929−-done
930−-
931− echo 'startplasmacompositor: Starting up...' 1>&2
932−
933−-# Make sure that the KDE prefix is first in XDG_DATA_DIRS and that it's set at all.
934−-# The spec allows XDG_DATA_DIRS to be not set, but X session startup scripts tend
935−-# to set it to a list of paths *not* including the KDE prefix if it's not /usr or
936−-# /usr/local.
937−-if test -z "$XDG_DATA_DIRS"; then
938−-XDG_DATA_DIRS="@KDE_INSTALL_FULL_DATADIR@:/usr/share:/usr/local/share"
939−-fi
940−-export XDG_DATA_DIRS
941−-
942− # Make sure that D-Bus is running
943−-if qdbus >/dev/null 2>/dev/null; then
944−+if @NIXPKGS_QDBUS@ >/dev/null 2>/dev/null; then
945− : # ok
946− else
947− echo 'startplasmacompositor: Could not start D-Bus. Can you call qdbus?' 1>&2
948−@@ -212,7 +237,7 @@ export KDE_FULL_SESSION
949− KDE_SESSION_VERSION=5
950− export KDE_SESSION_VERSION
951−
952−-KDE_SESSION_UID=`id -ru`
953−+KDE_SESSION_UID=$(@NIXPKGS_ID@ -ru)
954− export KDE_SESSION_UID
955−
956− XDG_CURRENT_DESKTOP=KDE
957−@@ -221,20 +246,41 @@ export XDG_CURRENT_DESKTOP
958− XDG_SESSION_TYPE=wayland
959− export XDG_SESSION_TYPE
960−
961−+# Source scripts found in <config locations>/plasma-workspace/env/*.sh
962−+# (where <config locations> correspond to the system and user's configuration
963−+# directories, as identified by Qt's qtpaths, e.g. $HOME/.config
964−+# and /etc/xdg/ on Linux)
965−+#
966−+# This is where you can define environment variables that will be available to
967−+# all KDE programs, so this is where you can run agents using e.g. eval `ssh-agent`
968−+# or eval `gpg-agent --daemon`.
969−+# Note: if you do that, you should also put "ssh-agent -k" as a shutdown script
970−+#
971−+# (see end of this file).
972−+# For anything else (that doesn't set env vars, or that needs a window manager),
973−+# better use the Autostart folder.
974−+
975−+IFS=":" read -r -a scriptpath <<< $(@NIXPKGS_QTPATHS@ --paths GenericConfigLocation)
976−+# Add /env/ to the directory to locate the scripts to be sourced
977−+for prefix in "${scriptpath[@]}"; do
978−+ for file in "$prefix"/plasma-workspace/env/*.sh; do
979−+ if [ -r "$file" ]; then
980−+ . "$file"
981−+ fi
982−+ done
983−+done
984−+
985− # kwin_wayland can possibly also start dbus-activated services which need env variables.
986− # In that case, the update in startplasma might be too late.
987−-if which dbus-update-activation-environment >/dev/null 2>/dev/null ; then
988−- dbus-update-activation-environment --systemd --all
989−-else
990−- @CMAKE_INSTALL_FULL_LIBEXECDIR@/ksyncdbusenv
991−-fi
992−-if test $? -ne 0; then
993−- # Startup error
994−- echo 'startplasmacompositor: Could not sync environment to dbus.' 1>&2
995−- exit 1
996−+if ! @NIXPKGS_DBUS_UPDATE_ACTIVATION_ENVIRONMENT@ --systemd --all; then
997−+ # Startup error
998−+ echo 'startkde: Could not sync environment to dbus.' 1>&2
999−+ test -n "$ksplash_pid" && kill "$ksplash_pid" 2>/dev/null
1000−+ echo 'startplasmacompositor: Could not sync environment to dbus.' 1>&2
1001−+ exit 1
1002− fi
1003−
1004−-@KWIN_WAYLAND_BIN_PATH@ --xwayland --libinput --exit-with-session=@CMAKE_INSTALL_FULL_LIBEXECDIR@/startplasma
1005−+@KWIN_WAYLAND_BIN_PATH@ --xwayland --libinput --exit-with-session=@NIXPKGS_STARTPLASMA@
1006−
1007− echo 'startplasmacompositor: Shutting down...' 1>&2
1008−