File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -1037,8 +1037,9 @@ main() {
10371037 fi
10381038
10391039 if [[ -n ${flake} ]]; then
1040- system_features=$( runSshNoTty -o ConnectTimeout=10 nix --extra-experimental-features ' nix-command' config show system-features 2> /dev/null || true)
1041-
1040+ system_features=$( runSshNoTty -o ConnectTimeout=10 nix --extra-experimental-features ' nix-command' config show system-features)
1041+ # Escape the bash variable for safe interpolation into Nix
1042+ system_features=" $( printf ' %s' " $system_features " | sed ' s/\\/\\\\/g; s/"/\\"/g' ) "
10421043 # First, try to evaluate all nix settings from the flake in one go
10431044 nixConfContent=$( nix --extra-experimental-features ' nix-command flakes' eval --raw --apply "
10441045 config:
@@ -1054,7 +1055,7 @@ main() {
10541055 remoteFeaturesStr = \" ${system_features} \" ;
10551056 # Parse remote features string (space-separated) into list
10561057 remoteFeaturesList = if remoteFeaturesStr != \"\" then
1057- builtins.filter (x: x != \"\" ) (builtins.split \" +\" remoteFeaturesStr)
1058+ builtins.filter (x: builtins.isString x && x != \"\" ) (builtins.split \" +\" remoteFeaturesStr)
10581059 else [];
10591060 in remoteFeaturesList;
10601061
@@ -1083,7 +1084,10 @@ main() {
10831084 if [[ -n ${nixConfContent} ]]; then
10841085 runSsh sh << SSH
10851086mkdir -p ~/.config/nix
1086- echo "${nixConfContent} " >> ~/.config/nix/nix.conf
1087+ printf '%s\n' "\$ (cat <<'CONTENT'
1088+ ${nixConfContent}
1089+ CONTENT
1090+ )" >> ~/.config/nix/nix.conf
10871091SSH
10881092 fi
10891093 fi
You can’t perform that action at this time.
0 commit comments