File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -586,9 +586,14 @@ generateHardwareConfig() {
586586 fi
587587 if [[ ${hasNixOSFacter} == " n" ]]; then
588588 step " Generating facter.json using nixos-facter from nixpkgs"
589- runSshNoTty -o ConnectTimeout=10 ${maybeSudo} \
590- nix run " ${nixOptions[@]} " \
591- nixpkgs#nixos-facter > " $hardwareConfigPath "
589+
590+ # We need to quote all the flags before they get passed to SSH
591+ # otherwise SSH will drop the quotes which is necessary for
592+ # `--extra-experimental-features "nix-command flakes"`.
593+ # We can use the following Bash-ism described at: https://www.gnu.org/savannah-checkouts/gnu/bash/manual/bash.html#Shell-Parameter-Expansion-1
594+ # For more information: https://unix.stackexchange.com/questions/379181/escape-a-variable-for-use-as-content-of-another-script
595+ runSshNoTty -o ConnectTimeout=10 \
596+ nix shell " ${nixOptions[@]@ Q} " nixpkgs#nixos-facter -c ${maybeSudo} nixos-facter > " $hardwareConfigPath "
592597 else
593598 step " Generating facter.json using nixos-facter"
594599 runSshNoTty -o ConnectTimeout=10 ${maybeSudo} nixos-facter > " $hardwareConfigPath "
You can’t perform that action at this time.
0 commit comments