-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
xdg-portal: update env vars, match nixos module #5158
Conversation
33edb0e
to
2aec824
Compare
Nixpkgs has recently made a few major changes to its xdg-desktop-portal package, which silently breaks our module here: - The NIXOS_XDG_DESKTOP_PORTAL_CONFIG_DIR variable patch has been removed (in favor of putting portal configurations in /etc or XDG_CONFIG_HOME). - A new variable, NIX_XDG_DESKTOP_PORTAL_DIR, was introduced in a patch to avoid setting XDG_DESKTOP_PORTAL_DIR (which also affected portal configuration reading, not only portal definitions) I updated our module to match the changes, but this breakage also made me revisit this module and look into some improvements. Long story short, I think it's worth it to make it more similar to the NixOS one, as it will make behavior more predictable and consistent. The main change is relying on the upstream linked systemd unit (instead of using systemd.user.services), and setting the environment variables globally instead of scoping it to the unit, as it's a very global thing anyway.
2aec824
to
1c2acec
Compare
Thanks! Merged to master now 🙂 |
This broke portals for me.
Edit2: |
Hey @andresilva, I can reproduce your issue when using the NixOS module and I will open a follow up PR adding this info to the manual, similarly to |
Alternatively, I wonder if the module could perhaps provide a sane Also, #2548 possibly fixes this, too. |
Note added in #5184 |
I ran into issues with this solution. Somehow A solution that did work was to explicitly set
Would this be an viable solution to adopt in home-manager? |
Hey @bobvanderlinden, I went with the profile approach as it is more consistent with the NixOS module, and relying on these nixpkgs-specific variables is a little risky, in my opinion (as this PR was written to fix breakage caused by The issue you're facing, I believe, only happens if you're running NixOS and have
See #5184 |
Specifically, add note about useUserPackages and pathsToLink. As suggested in <nix-community#5158 (comment)>.
Specifically, add note about useUserPackages and pathsToLink. As suggested in <nix-community#5158 (comment)>.
Specifically, add note about useUserPackages and pathsToLink. As suggested in <nix-community#5158 (comment)>.
Specifically, add note about useUserPackages and pathsToLink. As suggested in <nix-community#5158 (comment)>.
Description
Nixpkgs has recently(ish) made a few major changes to its xdg-desktop-portal package (NixOS/nixpkgs#268197), which silently breaks our module here:
I updated our module to match the changes, but this breakage also made me revisit this module and look into some improvements.
Long story short, I think it's worth it to make it more similar to the NixOS one, as it will make behavior more predictable and consistent.
The main change is relying on the upstream linked systemd unit (instead of using systemd.user.services), and setting the environment variables globally instead of scoping it to the unit, as it's a very global thing anyway.
This might not be backwards compatible for people already facing #4922/#4972. Maybe I should also provide the unit to ~/.config?
Checklist
Change is backwards compatible.
Code formatted with
./format
.Code tested through
nix-shell --pure tests -A run.all
ornix develop --ignore-environment .#all
using Flakes.Test cases updated/added. See example.
Commit messages are formatted like
See CONTRIBUTING for more information and recent commit messages for examples.
If this PR adds a new module
Maintainer CC