nix-community / nixos-anywhere

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

document operation with minimal copying from local #340

Open colemickens opened 2 months ago

colemickens commented 2 months ago

Hi,

I have a situation where it's easy for me to push to a cache, and easy to pull from the cache, but very excruciatingly slow to copy from the local machine.

I'm opening this to collect suggestions on how to minimize the paths that are copied from local.

Potential criteria to close this:

Also open to feedback if this is a bad idea, etc.

phaer commented 2 months ago

Would it help to use --build-on-target? This might avoid much of the copying, as nix wouldn't need copy much more than the flake itself, while substituting direct from the cache.

colemickens commented 1 month ago

Aye, indeed, I was doing that. Even copying the source to the destination was excruciatingly slow. My wifi was so bad that I never even managed to get it to work. I had to eventually SSH to another server, and run it from there.

If I could have pre-staged the source derivation, disko script, etc, into a cache, the builder could just download it.

It's probably just a matter of finding the right attr path for the source derivations and pushing those. Then it should just substitute if I pass the right options.

Mic92 commented 1 month ago

You can follow our nixos test. You need the disko-script and nixos toplevel in your binary cache: https://github.com/nix-community/nixos-anywhere/blob/024e3d461375bba7775062055388efee69288237/tests/modules/installer.nix#L18