[Nix-dev] nix-bundle: Bundle Nix derivations to run anywhere

Roger Qiu roger.qiu at matrix.ai
Tue Feb 7 22:37:15 CET 2017


When I exported a docker image to take look at what it is, it was also just
a compressed set of tar'ed file trees.
On 08/02/2017 7:46 AM, "Arnold Krille" <arnold at arnoldarts.de> wrote:

> On Mon, 6 Feb 2017 18:33:19 -0600 Matthew Bauer <mjbauer95 at gmail.com>
> wrote:
> > GitHub page: https://github.com/matthewbauer/nix-bundle
> >
> > I just wanted to post about a little project I've been working on. I'm
> > calling it "nix-bundle".
> >
> > Basically, what it does is: take a Nix closure, compress it into a
> > tarball, and turn that tarball into an executable using "Arx". The
> > final result looks like a plain shell script, but actually has a
> > tarball closure appended to it. When you run that script, Arx will
> > execute "nix-user-chroot" (which is included in the closure) which
> > will setup a /nix/ directory, then execute a target executable. All of
> > this should work "out of the box" for any Nix derivation folder with a
> > valid executable.
> >
> > For example, to generate a "hello" bundle:
> >
> > ./nix-bundle.sh hello /bin/hello
> >
> > "hello" specifies pkgs.hello and /bin/hello specifies the file
> > ${pkgs.helloi}/bin/hello to be executed. The output file will just be
> > called "hello".
> >
> > The result is a "bundle" that can run without Nix being installed! No
> > external dependencies are needed because they are all contained within
> > the Nix closure.
>
> So instead of pushing docker images around to bring an app into
> non-nix-production, we can just push around a tar'ed nix tree? Nice.
>
> - Arnold
>
> _______________________________________________
> nix-dev mailing list
> nix-dev at lists.science.uu.nl
> http://lists.science.uu.nl/mailman/listinfo/nix-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.science.uu.nl/pipermail/nix-dev/attachments/20170208/d91eb8f9/attachment.html>


More information about the nix-dev mailing list