[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&#39;ed file trees.</p> <div class="gmail_quote">On \
08/02/2017 7:46 AM, &quot;Arnold Krille&quot; &lt;<a \
href="mailto:arnold@arnoldarts.de">arnold@arnoldarts.de</a>&gt; 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 &lt;<a \
href="mailto:mjbauer95@gmail.com">mjbauer95@gmail.com</a>&gt;<br> wrote:<br>
&gt; GitHub page: <a href="https://github.com/matthewbauer/nix-bundle" \
rel="noreferrer" target="_blank">https://github.com/<wbr>matthewbauer/nix-bundle</a><br>
 &gt;<br>
&gt; I just wanted to post about a little project I&#39;ve been working on. \
I&#39;m<br> &gt; calling it &quot;nix-bundle&quot;.<br>
&gt;<br>
&gt; Basically, what it does is: take a Nix closure, compress it into a<br>
&gt; tarball, and turn that tarball into an executable using &quot;Arx&quot;. The<br>
&gt; final result looks like a plain shell script, but actually has a<br>
&gt; tarball closure appended to it. When you run that script, Arx will<br>
&gt; execute &quot;nix-user-chroot&quot; (which is included in the closure) which<br>
&gt; will setup a /nix/ directory, then execute a target executable. All of<br>
&gt; this should work &quot;out of the box&quot; for any Nix derivation folder with \
a<br> &gt; valid executable.<br>
&gt;<br>
&gt; For example, to generate a &quot;hello&quot; bundle:<br>
&gt;<br>
&gt; ./nix-bundle.sh hello /bin/hello<br>
&gt;<br>
&gt; &quot;hello&quot; specifies pkgs.hello and /bin/hello specifies the file<br>
&gt; ${pkgs.helloi}/bin/hello to be executed. The output file will just be<br>
&gt; called &quot;hello&quot;.<br>
&gt;<br>
&gt; The result is a &quot;bundle&quot; that can run without Nix being installed! \
No<br> &gt; external dependencies are needed because they are all contained \
within<br> &gt; 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&#39;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