mirror of
https://github.com/nix-community/home-manager
synced 2024-11-26 22:50:39 +00:00
home-manager: use XDG configuration directory
This commit is contained in:
parent
a4c0fead1f
commit
efb5256d28
1 changed files with 4 additions and 3 deletions
|
@ -26,8 +26,9 @@ function setConfigFile() {
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
local defaultConfFile="${XDG_CONFIG_HOME:-$HOME/.config}/nixpkgs/home.nix"
|
||||||
local confFile
|
local confFile
|
||||||
for confFile in "$HOME/.config/nixpkgs/home.nix" \
|
for confFile in "$defaultConfFile" \
|
||||||
"$HOME/.nixpkgs/home.nix" ; do
|
"$HOME/.nixpkgs/home.nix" ; do
|
||||||
if [[ -e "$confFile" ]] ; then
|
if [[ -e "$confFile" ]] ; then
|
||||||
HOME_MANAGER_CONFIG="$confFile"
|
HOME_MANAGER_CONFIG="$confFile"
|
||||||
|
@ -36,14 +37,14 @@ function setConfigFile() {
|
||||||
done
|
done
|
||||||
|
|
||||||
errorEcho "No configuration file found." \
|
errorEcho "No configuration file found." \
|
||||||
"Please create one at ~/.config/nixpkgs/home.nix"
|
"Please create one at $defaultConfFile"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
function setHomeManagerNixPath() {
|
function setHomeManagerNixPath() {
|
||||||
local path
|
local path
|
||||||
for path in "@HOME_MANAGER_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
|
"$HOME/.nixpkgs/home-manager" ; do
|
||||||
if [[ -e "$path" || "$path" =~ ^https?:// ]] ; then
|
if [[ -e "$path" || "$path" =~ ^https?:// ]] ; then
|
||||||
export NIX_PATH="$NIX_PATH${NIX_PATH:+:}home-manager=$path"
|
export NIX_PATH="$NIX_PATH${NIX_PATH:+:}home-manager=$path"
|
||||||
|
|
Loading…
Reference in a new issue