6
6
flakeAttr=" "
7
7
kexecUrl=" "
8
8
kexecExtraFlags=" "
9
+ sshStoreSettings=" "
9
10
enableDebug=" "
10
11
nixBuildFlags=()
11
12
diskoScript=" "
@@ -94,6 +95,8 @@ Options:
94
95
use another kexec tarball to bootstrap NixOS
95
96
* --kexec-extra-flags
96
97
extra flags to add into the call to kexec, e.g. "--no-sync"
98
+ * --ssh-store-setting <key> <value>
99
+ ssh store settings appended to the store URI, e.g. "compress true". <value> needs to be URI encoded.
97
100
* --post-kexec-ssh-port <ssh_port>
98
101
after kexec is executed, use a custom ssh port to connect. Defaults to 22
99
102
* --copy-host-keys
@@ -213,6 +216,14 @@ parseArgs() {
213
216
kexecExtraFlags=$2
214
217
shift
215
218
;;
219
+ --ssh-store-setting)
220
+ key=$2
221
+ shift
222
+ value=$2
223
+ shift
224
+ sshStoreSettings+=" $sshStoreSettings$key =$value &"
225
+ shift
226
+ ;;
216
227
--post-kexec-ssh-port)
217
228
postKexecSshPort=$2
218
229
shift
@@ -628,17 +639,17 @@ runDisko() {
628
639
runSsh " umask 077; mkdir -p \" $( dirname " $path " ) \" ; cat > $path " < " ${diskEncryptionKeys[$path]} "
629
640
done
630
641
if [[ -n ${diskoScript} ]]; then
631
- nixCopy --to " ssh://$sshConnection " " $diskoScript "
642
+ nixCopy --to " ssh://$sshConnection ? $sshStoreSettings " " $diskoScript "
632
643
elif [[ ${buildOn} == " remote" ]]; then
633
644
step Building disko script
634
645
# We need to do a nix copy first because nix build doesn't have --no-check-sigs
635
646
# Use ssh:// here to avoid https://github.com/NixOS/nix/issues/7359
636
- nixCopy --to " ssh://$sshConnection " " ${flake} #${flakeAttr} .system.build.${diskoMode} Script" \
647
+ nixCopy --to " ssh://$sshConnection ? $sshStoreSettings " " ${flake} #${flakeAttr} .system.build.${diskoMode} Script" \
637
648
--derivation --no-check-sigs
638
649
# If we don't use ssh-ng here, we get `error: operation 'getFSAccessor' is not supported by store`
639
650
diskoScript=$(
640
651
nixBuild " ${flake} #${flakeAttr} .system.build.${diskoMode} Script" \
641
- --eval-store auto --store " ssh-ng://$sshConnection ?ssh-key=$sshKeyDir /nixos -anywhere"
652
+ --eval-store auto --store " ssh-ng://$sshConnection ?ssh-key=$sshKeyDir %2Fnixos -anywhere& $sshStoreSettings "
642
653
)
643
654
fi
644
655
@@ -650,17 +661,17 @@ nixosInstall() {
650
661
local nixosSystem=$1
651
662
if [[ -n ${nixosSystem} ]]; then
652
663
step Uploading the system closure
653
- nixCopy --to " ssh://$sshConnection ?remote-store=local?root=/mnt " " $nixosSystem "
664
+ nixCopy --to " ssh://$sshConnection ?remote-store=local%3Froot=%2Fmnt& $sshStoreSettings " " $nixosSystem "
654
665
elif [[ ${buildOn} == " remote" ]]; then
655
666
step Building the system closure
656
667
# We need to do a nix copy first because nix build doesn't have --no-check-sigs
657
668
# Use ssh:// here to avoid https://github.com/NixOS/nix/issues/7359
658
- nixCopy --to " ssh://$sshConnection ?remote-store=local?root=/mnt " " ${flake} #${flakeAttr} .system.build.toplevel" \
669
+ nixCopy --to " ssh://$sshConnection ?remote-store=local%3Froot=%2Fmnt& $sshStoreSettings " " ${flake} #${flakeAttr} .system.build.toplevel" \
659
670
--derivation --no-check-sigs
660
671
# If we don't use ssh-ng here, we get `error: operation 'getFSAccessor' is not supported by store`
661
672
nixosSystem=$(
662
673
nixBuild " ${flake} #${flakeAttr} .system.build.toplevel" \
663
- --eval-store auto --store " ssh-ng://$sshConnection ?ssh-key=$sshKeyDir /nixos -anywhere&remote-store=local?root=/mnt "
674
+ --eval-store auto --store " ssh-ng://$sshConnection ?ssh-key=$sshKeyDir %2Fnixos -anywhere&remote-store=local%3Froot=%2Fmnt& $sshStoreSettings "
664
675
)
665
676
fi
666
677
0 commit comments