Skip to content
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/flatpak: add flatpak's XDG_DATA_DIRS to the environment #40881

Merged
merged 1 commit into from May 22, 2018

Conversation

hedning
Copy link
Contributor

@hedning hedning commented May 21, 2018

Motivation for this change

When installing programs with flatpak the desktop environment is unable to find the .desktop files. We need to expose them through XDG_DATA_DIRS.

The added directories gets prepended to XDG_DATA_DIRS which might not be ideal. Not sure how to fix that.

cc @jtojnar

Things done

Tested in a VM with gdm and gnome to make sure the variables are picked up.

  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@jtojnar
Copy link
Contributor

jtojnar commented May 21, 2018

I do not think it is much of a problem. Also we are already doing the same thing with PATH so it makes sense.

@matthewbauer
Copy link
Member

Can you refactor it to use environment.profiles instead?

https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/programs/environment.nix#L26

We use environment.profiles to add both the PATH and XDG_DATA_DIRS.
@hedning
Copy link
Contributor Author

hedning commented May 22, 2018

Does that look good? I left XDG_DESKTOP_PORTAL_PATH as a variable, not sure if it made sense to do

environment.profileRelativeEnvVars = {
  XDG_DESKTOP_PORTAL_PATH = [ "/share/xdg-desktop-portal/portals" ];
};

@matthewbauer
Copy link
Member

Looks good! The portal thing is fine to leave outz

@matthewbauer matthewbauer merged commit 009d434 into NixOS:master May 22, 2018
@hedning hedning deleted the flatpax-xdg-data-dirs branch March 1, 2020 11:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants