home-manager: resolve default configuration file path

Home Manager needs an absolute and resolved path to its configuration
file. The default configuration path is absolute but not necessarily
resolved. For example, some users may have `~/.config` be a symbolic
link to somewhere else. We therefore run the default configuration
path through the `realpath` tool to resolve it.

Fixes #304
This commit is contained in:
Robert Helgesson 2018-07-12 00:30:54 +02:00
parent dadfaed829
commit f4a1a5e94c
No known key found for this signature in database
GPG key ID: 36BDAA14C2797E89

View file

@ -32,7 +32,7 @@ function setConfigFile() {
for confFile in "$defaultConfFile" \
"$HOME/.nixpkgs/home.nix" ; do
if [[ -e "$confFile" ]] ; then
HOME_MANAGER_CONFIG="$confFile"
HOME_MANAGER_CONFIG="$(realpath "$confFile")"
return
fi
done