Skip to content

Add nix dirs to XDG_DATA_DIRS so it can pick up .desktop files for GUI apps #614

@chewblacka

Description

@chewblacka

The DS Nix installer is close to becoming a first-class citizen for installing nix packages on non-NixOS distributions. One current issue though is that .desktop files for GUI apps are not auto-picked-up by the DE. This is easy to rectify though. Simply add a file to etc/profile.d/ containing the following line:

export XDG_DATA_DIRS="${HOME}/.nix-profile/share:/nix/var/nix/profiles/default/share:${XDG_DATA_DIRS}"

I called my file nix-xdg-data-dirs.sh but /etc/profile.d/ already contains nix.sh which calls /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh so the XDG_DATA_DIRS line could simply be added to this latter file by the installer.

Using the syntax of the existing file nix-daemon.sh, I believe the correct line to add to it would be:

export XDG_DATA_DIRS="$NIX_LINK/share:/nix/var/nix/profiles/default/share:$XDG_DATA_DIRS"

This could go directly after the existing export PATH command.
Many thanks for the great ongoing work!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions