1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-18 00:59:44 +01:00

targets/generic-linux: use xdg path for defexpr

Fixes warnings about the non-existent `~/.nix-defexpr` folder when
using `use-xdg-base-directories = true`.

Example:

    warning: Nix search path entry '/home/user/.nix-defexpr/channels' does not exist, ignoring
    Starting Home Manager activation
    Activating checkFilesChanged
    Activating checkLinkTargets
    Activating writeBoundary
    Activating installPackages
    replacing old 'home-manager-path'
    installing 'home-manager-path'
    Activating dconfSettings
    Activating linkDesktopApplications
    Activating linkGeneration
    Cleaning up orphan links from /home/user
    No change so reusing latest profile generation 13
    Creating home file links in /home/user
    Activating onFilesChange
    Activating reloadSystemd
    warning: Nix search path entry '/home/user/.nix-defexpr/channels' does not exist, ignoring
This commit is contained in:
Igor 2024-02-27 21:48:27 +00:00 committed by Robert Helgesson
parent 16311f1d3c
commit b0b0c3d943
No known key found for this signature in database
GPG key ID: 96E745BD17AA17ED

View file

@ -99,7 +99,11 @@ in {
"/usr/share/terminfo" # package default, all distros
];
in {
NIX_PATH = "$HOME/.nix-defexpr/channels\${NIX_PATH:+:}$NIX_PATH";
NIX_PATH = if config.nix.enable
&& (config.nix.settings.use-xdg-base-directories or false) then
"${config.xdg.stateHome}/nix/defexpr/channels\${NIX_PATH:+:}$NIX_PATH"
else
"$HOME/.nix-defexpr/channels\${NIX_PATH:+:}$NIX_PATH";
TERMINFO_DIRS =
"${profileDirectory}/share/terminfo:$TERMINFO_DIRS\${TERMINFO_DIRS:+:}${distroTerminfoDirs}";
};