6
submitted 8 months ago by dadarobot@lemmy.ml to c/nix@programming.dev

long story short: i have a surface tablet with an sd card in it. id like the sd card to hold /nix. i cant seem to rsync without (im guessing the links are expanding) the bigger drive (sdcard) filling up. thank you

top 2 comments
sorted by: hot top new old
[-] difficult@sh.itjust.works 5 points 8 months ago

rsync has -H flag for preserving hardlinks

[-] FauxLiving@lemmy.world 4 points 8 months ago

Probably rsync -aH would do just fine, but Nix has a tool for this.

https://nix.dev/manual/nix/2.18/command-ref/new-cli/nix3-copy

Their closest direct example is using SSH:

Copy the entire current NixOS system closure to another machine via SSH:

# nix copy --substitute-on-destination --to ssh://server /run/current-system

The -s flag causes the remote machine to try to substitute missing store paths, which may be faster if the link between the local and remote machines is slower than the link between the remote machine and its substituters (e.g. https://cache.nixos.org/).

this post was submitted on 21 Mar 2026
6 points (87.5% liked)

Nix / NixOS

2949 readers
27 users here now

Main links

Videos

founded 3 years ago
MODERATORS