1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-23 03:29:45 +01:00

home-manager: use XDG configuration directory

This commit is contained in:
Robert Helgesson 2017-10-28 23:01:42 +02:00
parent a4c0fead1f
commit efb5256d28
No known key found for this signature in database
GPG key ID: C3DB11069E65DC86

View file

@ -26,8 +26,9 @@ function setConfigFile() {
return
fi
local defaultConfFile="${XDG_CONFIG_HOME:-$HOME/.config}/nixpkgs/home.nix"
local confFile
for confFile in "$HOME/.config/nixpkgs/home.nix" \
for confFile in "$defaultConfFile" \
"$HOME/.nixpkgs/home.nix" ; do
if [[ -e "$confFile" ]] ; then
HOME_MANAGER_CONFIG="$confFile"
@ -36,14 +37,14 @@ function setConfigFile() {
done
errorEcho "No configuration file found." \
"Please create one at ~/.config/nixpkgs/home.nix"
"Please create one at $defaultConfFile"
exit 1
}
function setHomeManagerNixPath() {
local path
for path in "@HOME_MANAGER_PATH@" \
"$HOME/.config/nixpkgs/home-manager" \
"${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"