nix-community / nixos-anywhere

install nixos everywhere via ssh [maintainer=@numtide]
https://nix-community.github.io/nixos-anywhere/
MIT License
1.53k stars 106 forks source link

Add option --ssh-store-settings #358

Open aabccd021 opened 1 month ago

aabccd021 commented 1 month ago

This flag allows users to run nixos-anywhere with extra settings for SSH store, by appending it to ssh store url.

If a user has fast connection between client and target, but slow internet connection on target, the user can use --no-substitute-on-destination to copy closures from client instead of downloading it from internet.

The copy speed (nix-copy to ssh store) can be greatly improved by enabling compression via --ssh-store-settings "compress=true".

Existing url parameters (especially the special characters) need to be encoded to avoid unexpected results. Otherwise we will get something like root evaluates to /mnt?compression=true.

aabccd021 commented 1 month ago

The code intentionally have ? and & at the end of the URL even without store settings passed, which is still a valid URL.

This is done to avoid complexity and make the PR diff as small as possible.

Please let me know if we want to not include these characters when ssh store settings are not used.