New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nixos/xsession: check for env vars #42677
Conversation
Old script did not check for $XCOMPOSECACHE and $XDG_DATA_HOME environment variables.
Thank you for contributing to Nix. Since you are using the XDG variables for the data path, how about |
Aren't these env vars usually set up after this point and potentially in the sessions themselves? I for example have a ~/.xsession file that ends up setting the correct nixpkgs/nixos/modules/services/x11/display-managers/default.nix Lines 132 to 135 in 9137f83
So this script doesn't even get the chance to see the correct env vars. |
@peterhoeg ~/.compose-cache is the default location, so if it has not been set by the user, other applications (e.g compose (5)) will read from ~/.compose-cache. This patch would have no effect unless the user specifically exports XCOMPOSECACHE. |
@infinisil The exact time that the environment variables are set depends on where they are defined. You are correct that, if they are set in
|
The problem is that |
It also occurred to me that we could expose |
@infinisil Apologies, I am not familiar with "manual" Xorg setups (I use KDE plasma). From looking at the xsession script, it seems like these env vars could be set in |
That might work |
@infinisil Bump? Is there some proper way to request attention? I'm new to git/github, so sorry if this is the wrong way to go about it |
@infinisil |
Not sure, maybe try pinging some people that were involved with this part of the code in the past |
As a KDE user, how would you go about overriding the location of the compose cache? Otherwise this looks fine to me but please run the various tests (sddm, plasma5, xfce, gnome3) to ensure this isn't breaking anything. |
@peterhoeg Personally, I set XCOMPOSECACHE in /etc/profile, though I imagine you could do it on a per-user basis with ~/.xprofile or ~/.pam_environment |
What is the status of this pull request? |
While trying to declutter my |
@@ -110,22 +115,19 @@ let | |||
|
|||
# Speed up application start by 50-150ms according to | |||
# http://kdemonkey.blogspot.nl/2008/04/magic-trick.html | |||
rm -rf "$HOME/.compose-cache" | |||
mkdir "$HOME/.compose-cache" | |||
compose_cache="''${$XCOMPOSECACHE:-$HOME/.compose-cache}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't the $
before XCOMPOSECACHE be dropped?
mkdir "$HOME/.compose-cache" | ||
compose_cache="''${$XCOMPOSECACHE:-$HOME/.compose-cache}" | ||
rm -rf "$compose_cache" | ||
mkdir -p "$compose_cache" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe explicitly unset compose_cache
when we're done with it?
Read $XCOMPOSECACHE and $XDG_DATA_HOME environment variables when writing ~/.compose-cache and ~/.local/share, otherwise use default values.
Motivation for this change
Old script did not check for $XCOMPOSECACHE and $XDG_DATA_HOME
environment variables.
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)nix path-info -S
before and after)