nixos/plasma: leave displayManager.setupCommands alone

Commit
4832352d02
replaced the plasma5 session startup
script with its upstream version from the
`pkgs.libsForQt5.plasma5.plasma-workspace` package.
In the course of doing so, the old session startup script
wasn't removed, but got moved into the display manager
startup shell commands option `displayManager.setupCommands`.
This now causes those commands to be executed
whenever the configured display manager starts.

The old startup script performed some basic
initializations in the user's home directory.
With the new arrangement, the old startup script is run with
HOME=/, leading to a lot of clutter in the root filesystem
(entries like `/.config` or `/.gitrc-2.0`).

The commit at hand simply removes the
old session startup script completely,
and with it a lot of now unused code from the plasma5 module.
This commit is contained in:
Yarny0 2022-11-06 16:28:21 +01:00
parent 3bacde6273
commit 5e635986ca

View File

@ -28,52 +28,11 @@ let
libsForQt5 = pkgs.plasma5Packages;
inherit (libsForQt5) kdeGear kdeFrameworks plasma5;
inherit (pkgs) writeText;
inherit (lib)
getBin optionalString literalExpression
mkRemovedOptionModule mkRenamedOptionModule
mkDefault mkIf mkMerge mkOption types;
ini = pkgs.formats.ini { };
gtkrc2 = writeText "gtkrc-2.0" ''
# Default GTK+ 2 config for NixOS Plasma 5
include "/run/current-system/sw/share/themes/Breeze/gtk-2.0/gtkrc"
style "user-font"
{
font_name="Sans Serif Regular"
}
widget_class "*" style "user-font"
gtk-font-name="Sans Serif Regular 10"
gtk-theme-name="Breeze"
gtk-icon-theme-name="breeze"
gtk-fallback-icon-theme="hicolor"
gtk-cursor-theme-name="breeze_cursors"
gtk-toolbar-style=GTK_TOOLBAR_ICONS
gtk-menu-images=1
gtk-button-images=1
'';
gtk3_settings = ini.generate "settings.ini" {
Settings = {
gtk-font-name = "Sans Serif Regular 10";
gtk-theme-name = "Breeze";
gtk-icon-theme-name = "breeze";
gtk-fallback-icon-theme = "hicolor";
gtk-cursor-theme-name = "breeze_cursors";
gtk-toolbar-style = "GTK_TOOLBAR_ICONS";
gtk-menu-images = 1;
gtk-button-images = 1;
};
};
kcminputrc = ini.generate "kcminputrc" {
Mouse = {
cursorTheme = "breeze_cursors";
cursorSize = 0;
};
};
activationScript = ''
${set_XDG_CONFIG_HOME}
@ -119,37 +78,6 @@ let
XDG_CONFIG_HOME=''${XDG_CONFIG_HOME:-$HOME/.config}
'';
startplasma = ''
${set_XDG_CONFIG_HOME}
mkdir -p "''${XDG_CONFIG_HOME}"
'' + optionalString config.hardware.pulseaudio.enable ''
# Load PulseAudio module for routing support.
# See also: http://colin.guthr.ie/2009/10/so-how-does-the-kde-pulseaudio-support-work-anyway/
${getBin config.hardware.pulseaudio.package}/bin/pactl load-module module-device-manager "do_routing=1"
'' + ''
${activationScript}
# Create default configurations if Plasma has never been started.
kdeglobals="''${XDG_CONFIG_HOME}/kdeglobals"
if ! [ -f "$kdeglobals" ]; then
kcminputrc="''${XDG_CONFIG_HOME}/kcminputrc"
if ! [ -f "$kcminputrc" ]; then
cat ${kcminputrc} >"$kcminputrc"
fi
gtkrc2="$HOME/.gtkrc-2.0"
if ! [ -f "$gtkrc2" ]; then
cat ${gtkrc2} >"$gtkrc2"
fi
gtk3_settings="''${XDG_CONFIG_HOME}/gtk-3.0/settings.ini"
if ! [ -f "$gtk3_settings" ]; then
mkdir -p "$(dirname "$gtk3_settings")"
cat ${gtk3_settings} >"$gtk3_settings"
fi
fi
'';
in
{
@ -449,7 +377,6 @@ in
# Update the start menu for each user that is currently logged in
system.userActivationScripts.plasmaSetup = activationScript;
services.xserver.displayManager.setupCommands = startplasma;
nixpkgs.config.firefox.enablePlasmaBrowserIntegration = true;
})