[prev in list] [next in list] [prev in thread] [next in thread]
List: nix-dev
Subject: Re: [Nix-dev] nix-bundle: Bundle Nix derivations to run anywhere
From: Roger Qiu <roger.qiu () matrix ! ai>
Date: 2017-02-07 21:37:15
Message-ID: CA+HLvX=GGZutaxh+h+qjpq7L2TjxUF49nqZqwLnFidJF0fwOHw () mail ! gmail ! com
[Download RAW message or body]
[Attachment #2 (multipart/alternative)]
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@arnoldarts.de> wrote:
> On Mon, 6 Feb 2017 18:33:19 -0600 Matthew Bauer <mjbauer95@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@lists.science.uu.nl
> http://lists.science.uu.nl/mailman/listinfo/nix-dev
>
>
[Attachment #5 (text/html)]
<p dir="ltr">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.</p> <div class="gmail_quote">On \
08/02/2017 7:46 AM, "Arnold Krille" <<a \
href="mailto:arnold@arnoldarts.de">arnold@arnoldarts.de</a>> wrote:<br \
type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 \
.8ex;border-left:1px #ccc solid;padding-left:1ex">On Mon, 6 Feb 2017 18:33:19 -0600 \
Matthew Bauer <<a \
href="mailto:mjbauer95@gmail.com">mjbauer95@gmail.com</a>><br> wrote:<br>
> GitHub page: <a href="https://github.com/matthewbauer/nix-bundle" \
rel="noreferrer" target="_blank">https://github.com/<wbr>matthewbauer/nix-bundle</a><br>
><br>
> I just wanted to post about a little project I've been working on. \
I'm<br> > calling it "nix-bundle".<br>
><br>
> Basically, what it does is: take a Nix closure, compress it into a<br>
> tarball, and turn that tarball into an executable using "Arx". The<br>
> final result looks like a plain shell script, but actually has a<br>
> tarball closure appended to it. When you run that script, Arx will<br>
> execute "nix-user-chroot" (which is included in the closure) which<br>
> will setup a /nix/ directory, then execute a target executable. All of<br>
> this should work "out of the box" for any Nix derivation folder with \
a<br> > valid executable.<br>
><br>
> For example, to generate a "hello" bundle:<br>
><br>
> ./nix-bundle.sh hello /bin/hello<br>
><br>
> "hello" specifies pkgs.hello and /bin/hello specifies the file<br>
> ${pkgs.helloi}/bin/hello to be executed. The output file will just be<br>
> called "hello".<br>
><br>
> The result is a "bundle" that can run without Nix being installed! \
No<br> > external dependencies are needed because they are all contained \
within<br> > the Nix closure.<br>
<br>
So instead of pushing docker images around to bring an app into<br>
non-nix-production, we can just push around a tar'ed nix tree? Nice.<br>
<br>
- Arnold<br>
<br>______________________________<wbr>_________________<br>
nix-dev mailing list<br>
<a href="mailto:nix-dev@lists.science.uu.nl">nix-dev@lists.science.uu.nl</a><br>
<a href="http://lists.science.uu.nl/mailman/listinfo/nix-dev" rel="noreferrer" \
target="_blank">http://lists.science.uu.nl/<wbr>mailman/listinfo/nix-dev</a><br> \
<br></blockquote></div>
_______________________________________________
nix-dev mailing list
nix-dev@lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic