nixos/plasma: leave displayManager.setupCommands alone#199881
nixos/plasma: leave displayManager.setupCommands alone#199881AndersonTorres merged 1 commit intoNixOS:masterfrom
displayManager.setupCommands alone#199881Conversation
Commit NixOS@4832352 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.
There was a problem hiding this comment.
I didn't apply your patch directly but setting services.xserver.displayManager.setupCommands = lib.mkForce ""; does fix that issue. I've tested this both on my current Plasma setup and on a fresh one in a VM. It would be great if we could get this PR into 22.11.
|
Thanks for your feedback, @azahi ! Given #187963 (comment) , I suppose you tested with SDDM display manager. I turned it into a proper (non-draft) PR now. I would be fine with this getting merged, but some feedback from @ttuegel or @pasqui23 would still be reassuring. |
inclyc
left a comment
There was a problem hiding this comment.
Not a serious review, but this patch is really helpful for me.
These commands create horrible directories & files: /.gtkrc and /.cache during system boot. The patch is a workaround of NixOS/nixpkgs#199881, NixOS/nixpkgs#187963. Link: NixOS/nixpkgs#187963 Link: NixOS/nixpkgs#199881 (review)
|
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/prs-ready-for-review/3032/1792 |
|
See second edit. Sorry for the noise. Goose chase enclosed
EDIT: I expected that the intent behind this change wasn't the real problem, but that this was broken by some other thing relying on some implicit behaviour here. With this PR applied, so with the breakage, the only thing required to fix is to ensure diff --git a/nixos/modules/services/x11/desktop-managers/plasma5.nix b/nixos/modules/services/x11/desktop-managers/plasma5.nix
index eb0373c686c..63013035220 100644
--- a/nixos/modules/services/x11/desktop-managers/plasma5.nix
+++ b/nixos/modules/services/x11/desktop-managers/plasma5.nix
@@ -78,6 +78,10 @@ let
XDG_CONFIG_HOME=''${XDG_CONFIG_HOME:-$HOME/.config}
'';
+ startplasma = ''
+ ${set_XDG_CONFIG_HOME}
+ '';
+
in
{
@@ -402,6 +406,7 @@ 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;
})Will be looking at a more correct fix, but this is interesting. On a hunch I tried an empty EDIT ♯2: alright, ignore all that, it was masking an error in my config by the presence of |
These commands create horrible directories & files: /.gtkrc and /.cache during system boot. The patch is a workaround of NixOS/nixpkgs#199881, NixOS/nixpkgs#187963. Link: NixOS/nixpkgs#187963 Link: NixOS/nixpkgs#199881 (review)
Description of changes
Fix #187963 . I bisected the problem down to commit 4832352 from #100057 .
That commit replaced the plasma5 session startup script with its upstream version from the
pkgs.libsForQt5.plasma5.plasma-workspacepackage. The old script performs some basic initializations in the user's home directory: It adds files/directories like.configand.gtkrc-2.0. Besides, it calls theactivationScriptof the plasma module which rebuilds the "kbuildsyscoca5 cache" (plasma start menu) in.cache.However, the old session startup script wasn't removed; it is now used as display manager setup script, i.e., it was added to the option
displayManager.setupCommands. I am not sure if this happened intentionally and if it has any advantage.Most likely, this means all the initialization efforts described above
HOME=/. So the display manager will create some dot files in the root filesystem.I suppose this is not the desired outcome.
The pull-request at hand completely removes the old session startup script. I guess this is the right thing to do, but I am not sure. The script wasn't applied to any user session since #100057 got merged in Oct 2021, so apparently it is not needed. All plasma-related tests (
plasma5,plasma5-systemd-start,plasma-bigscreenand evenmaestral) still pass with the pull request at hand applied. On the other hand, running the session startup script when the display manager starts up might have some positive effect that I am overlooking right now.Further notes
qt-kde) member @ttuegelNote that the effect of this pull request can easily be applied to a NixOS system -- without merging anything -- by just setting
services.xserver.displayManager.setupCommands = lib.mkForce "";inconfiguration.nix. This is what I am using on my desktop PC (NixOS 22.05 with plasma5 and lightdm) right now, without any issues. But it should probably be tested by some else as well, e.g. withsddmas display manager.Things done
sandbox = trueset innix.conf? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)nixos/doc/manual/md-to-db.shto update generated release notesResult of
nixpkgs-reviewrun on x86_64-linux 11 package blacklisted: