nixos-anywhere
nixos-anywhere copied to clipboard
rsync command not found with 23.11 nixos image
nixos-anywhere fails at copy extra file step using as installation target a machine booted with nixos 23.11 minimal iso image: https://channels.nixos.org/nixos-23.11/latest-nixos-minimal-x86_64-linux.iso
nixos-anywhere command: nix run github:numtide/nixos-anywhere -- --extra-files "$temp" --flake .#server02 root@$192.168.178.191
This is the error:
+ echo '### Copying extra files ###'
### Copying extra files ###
+ rsync -rlpv -FF -e 'ssh -i "/tmp/tmp.eYUCcg96wX"/nixos-anywhere -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no ' /tmp/tmp.Ol4VOcuUb6/ [email protected]:/mnt/
Warning: Permanently added '192.168.178.191' (ED25519) to the list of known hosts.
bash: line 1: rsync: command not found
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at io.c(231) [sender=3.2.7]
+ rm -rf /tmp/tmp.eYUCcg96wX
Using the 23.05 image installation works without any issue.
We should probably start making our own ISOs that have all needed tools.
Is there a workaround, besides using the 23.05 image?
Something like this before the nixos-everywhere call works:
ssh root@hostname "nix-env -iA nixos.rsync"
Another work around is building your own installer. nixos-generators works well for that.
maybe we can do a fallback with nix-shell? or even nix-env?
Editing /etc/nixos/configuration.nix and adding rsync to systemPackages with a nixos-rebuild test also works on current minimal iso.
environment.systemPackages = with pkgs; [
rsync
];
hmm, but thats a lot of hassle. Maybe we should just port the rsync code to scp?
https://github.com/nix-community/nixos-anywhere/pull/295 is the PR for that, not tested yet
We also create a new nixos-anywhere optimized installer image that has rsync installed and enables sshd by default: https://github.com/nix-community/nixos-images?tab=readme-ov-file#iso-installer-images
We also create a new nixos-anywhere optimized installer image that has rsync installed and enables sshd by default: nix-community/nixos-images#iso-installer-images
I saw this a few days ago and could not for the life of me figure out where the ISOs are actually hosted. I'm new to nix and figure I must misunderstand how it works.
EDIT: Found it. I mistook the assets for releases.
To anyone who is looking at this, #316 (or #325) has been merged and it solves the problem.