Remote Nix Shells

A minimalistic way to enter a nix-shell on a remote machine is the following: Instantiate a derivation, build it, copy its closure over and enter a nix-shell over ssh. This can be done in one operation using the following shell script:

remote-nix-shell.sh: creating a derivation in the local store.
remote-nix-shell.sh: building this derivation locally.
remote-nix-shell.sh: copying the derivation and its output to the host.
remote-nix-shell.sh: entering a remote shell.
foo
bar
baz
Hello, world!
nix-shell:~$