From 9437177e8204ee9c25f8f259bae50231bc904952 Mon Sep 17 00:00:00 2001 From: polykernel <81340136+polykernel@users.noreply.github.com> Date: Sun, 28 Nov 2021 20:48:21 -0500 Subject: [PATCH] home-manager: fix home-manager build error (#2514) Two misplaced quotations were introduced in `doBuild` by https://github.com/nix-community/home-manager/pull/2501, which caused the parameter expansion of DRY_RUN to include an extraneous tab. Since the flake uri is passed later into the command, Nix assumes the whitespace sequence as the flake uri and returns that it is not a valid flake reference. This PR removes the misplaced quotations in `doBuild` and also places the flake uri as the first argument for calls to `doBuildFlake` for consistency with `doBuildAttr`. Placing the uri first in the command line also guards against possible security issues if arbitrary uris are expanded prior to the user given uri. (cherry picked from commit 9de77227d7780518cfeaee5a917970247f3ecc56) --- home-manager/home-manager | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/home-manager/home-manager b/home-manager/home-manager index 990e1e5e..fc141062 100644 --- a/home-manager/home-manager +++ b/home-manager/home-manager @@ -263,9 +263,9 @@ function doBuild() { setFlakeAttribute if [[ -v FLAKE_CONFIG_URI ]]; then doBuildFlake \ - "${DRY_RUN+--dry-run} \ - "${NO_OUT_LINK+--no-link} \ "$FLAKE_CONFIG_URI.activationPackage" \ + ${DRY_RUN+--dry-run} \ + ${NO_OUT_LINK+--no-link} \ || return else doBuildAttr \ @@ -294,8 +294,8 @@ function doSwitch() { setFlakeAttribute if [[ -v FLAKE_CONFIG_URI ]]; then doBuildFlake \ - --out-link "$generation" \ "$FLAKE_CONFIG_URI.activationPackage" \ + --out-link "$generation" \ && "$generation/activate" || return else doBuildAttr \