1
0
mirror of https://github.com/nix-community/home-manager synced 2024-06-28 01:18:32 +02:00

home-manager: use absolute path to configuration

Nix needs an absolute path and the user may have given a relative path
for the configuration file. We therefore need to expand it using the
`realpath` tool.
This commit is contained in:
Robert Helgesson 2017-01-08 10:24:16 +01:00
parent a1cb111cc3
commit 671805009c
No known key found for this signature in database
GPG Key ID: C3DB11069E65DC86

View File

@ -6,13 +6,16 @@ function doRebuild() {
exit 1 exit 1
fi fi
local confFile
confFile="$(realpath "$1")"
local wrkdir local wrkdir
wrkdir="$(mktemp -d)" wrkdir="$(mktemp -d)"
nix-build --show-trace \ nix-build --show-trace \
"@HOME_MANAGER_EXPR_PATH@" \ "@HOME_MANAGER_EXPR_PATH@" \
--argstr modulesPath "$HOME/.nixpkgs/home-manager/modules" \ --argstr modulesPath "$HOME/.nixpkgs/home-manager/modules" \
--argstr confPath "$1" \ --argstr confPath "$confFile" \
-A activation-script \ -A activation-script \
-o "$wrkdir/activate" -o "$wrkdir/activate"