Quick Nix Copy question

Something like this should do the trick

# build (i have no idea how you build your MyApp.nix)
nix build --extra-experimental-features 'nix-command flakes' .#myapp

# copy the closure to the usb
nix copy --extra-experimental-features 'nix-command flakes' --to file:///usb $(readlink ./result)

# store closure path
readlink ./result > /usb/myapp-closure

# on target machine
nix copy --extra-experimental-features 'nix-command flakes' --from file:///usb $(cat /usb/myapp-closure)
1 Like