[Nix-dev] Copy a closure to machine with no Nix installed on it

Bjørn Forsman bjorn.forsman at gmail.com
Thu Mar 2 17:49:52 CET 2017


On 2 March 2017 at 17:38, Volth <volth at volth.com> wrote:
> Hello
>
> What is a good way to copy a closure to a Linux machine where Nix is
> not installed (and it is tricky to install: 1. there is only root
> account and 2. there may be no Internet access) ?
>
> "nix-copy-closure" expects "nix-store" on the target machine.
>
> Would "nix-store" be a single executable with no dependencies, it
> could be uploaded beforehand, but it has a lot of dependencies so its
> uploading is also the task of uploading a closure to a machine without
> Nix...

Don't know how to do it without Nix, but Nix can be installed offline.
Get the binary tarball for you system:

http://nixos.org/releases/nix/nix-1.11.7/nix-1.11.7-x86_64-linux.tar.bz2

Copy it to your target machine, unpack and run ./install from the
extracted tree.

That creates a single user install. It requires sudo to create the
/nix directory, everything else is owned and run by your user. (There
are ways to run nix from $HOME or wherever, I think "proot" is a good
search word.)

Once you have nix you have nix-copy-closure.

Hope that helps.

Best regards,
Bjørn Forsman


More information about the nix-dev mailing list