1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-14 15:19:45 +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 Mikilio
parent f16e7b5824
commit 8ea77d5efd
No known key found for this signature in database
GPG key ID: 5B2F1A890CF33F3F

View file

@ -99,7 +99,11 @@ in {
"/usr/share/terminfo" # package default, all distros "/usr/share/terminfo" # package default, all distros
]; ];
in { 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 = TERMINFO_DIRS =
"${profileDirectory}/share/terminfo:$TERMINFO_DIRS\${TERMINFO_DIRS:+:}${distroTerminfoDirs}"; "${profileDirectory}/share/terminfo:$TERMINFO_DIRS\${TERMINFO_DIRS:+:}${distroTerminfoDirs}";
}; };