mirror of
https://github.com/nix-community/home-manager
synced 2024-11-27 05:29:46 +01:00
home-manager: handle args with spaces to doBuildAttr
Presently, if you pass an argument with spaces in it to `doBuildAttr`, it will be split it into multiple arguments to `nix build` or `nix-build`. This situation arises, for example, on systems with spaces in `XDG_DATA_HOME`. Specifically, the `home-manager` script errors out in trying to address the `read-news` state file. With this change, argument separation should be preserved properly in `doBuildAttr`. PR #1044
This commit is contained in:
parent
9ab4e70d17
commit
9ab59dd6ac
1 changed files with 5 additions and 5 deletions
|
@ -78,28 +78,28 @@ function doBuildAttr() {
|
|||
setConfigFile
|
||||
setHomeManagerNixPath
|
||||
|
||||
local extraArgs="$*"
|
||||
local extraArgs=("$@")
|
||||
|
||||
for p in "${EXTRA_NIX_PATH[@]}"; do
|
||||
extraArgs="$extraArgs -I $p"
|
||||
extraArgs=("${extraArgs[@]}" "-I" "$p")
|
||||
done
|
||||
|
||||
if [[ -v VERBOSE ]]; then
|
||||
extraArgs="$extraArgs --show-trace"
|
||||
extraArgs=("${extraArgs[@]}" "--show-trace")
|
||||
fi
|
||||
|
||||
# shellcheck disable=2086
|
||||
if [[ -v USE_NIX2_COMMAND ]]; then
|
||||
nix build \
|
||||
-f "<home-manager/home-manager/home-manager.nix>" \
|
||||
$extraArgs \
|
||||
"${extraArgs[@]}" \
|
||||
"${PASSTHROUGH_OPTS[@]}" \
|
||||
--argstr confPath "$HOME_MANAGER_CONFIG" \
|
||||
--argstr confAttr "$HOME_MANAGER_CONFIG_ATTRIBUTE"
|
||||
else
|
||||
nix-build \
|
||||
"<home-manager/home-manager/home-manager.nix>" \
|
||||
$extraArgs \
|
||||
"${extraArgs[@]}" \
|
||||
"${PASSTHROUGH_OPTS[@]}" \
|
||||
--argstr confPath "$HOME_MANAGER_CONFIG" \
|
||||
--argstr confAttr "$HOME_MANAGER_CONFIG_ATTRIBUTE"
|
||||
|
|
Loading…
Reference in a new issue