home-manager: switch NIX_PATH order

This new order allows overriding the home-manager path from the
command line using `home-manager -I home-manager=/a/b/c`.
This commit is contained in:
Robert Helgesson 2018-01-14 11:11:36 +01:00
parent 8b77f1db2c
commit 81fb420457
No known key found for this signature in database
GPG key ID: C3DB11069E65DC86

View file

@ -48,7 +48,7 @@ function setHomeManagerNixPath() {
"${XDG_CONFIG_HOME:-$HOME/.config}/nixpkgs/home-manager" \
"$HOME/.nixpkgs/home-manager" ; do
if [[ -e "$path" || "$path" =~ ^https?:// ]] ; then
export NIX_PATH="$NIX_PATH${NIX_PATH:+:}home-manager=$path"
export NIX_PATH="home-manager=$path${NIX_PATH:+:}$NIX_PATH"
return
fi
done