[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: Tomasz Czyż <tomasz.czyz () gmail ! com>
Date: 2017-02-07 11:31:27
Message-ID: CAO1Hmo58ZmfgspMCV9-2LjT1pEMA7KCFJ3F3hRPU8Lxt-zz6gg () mail ! gmail ! com
[Download RAW message or body]
[Attachment #2 (multipart/alternative)]
Matthew,
very good tool, thank you for sharing.
2017-02-07 10:32 GMT+00:00 Domen Kožar <domen@dev.si>:
> Awesome! I will need this very soon, good timing :)
>
> On Tue, Feb 7, 2017 at 11:30 AM, Moritz Ulrich <moritz@tarn-vedra.de>
> wrote:
>
>>
>> Hey Matthew,
>>
>> This sounds great! I'll give it a try :-)
>>
>> One question: Will it create a persistent /nix directory on the machine
>> the generated binary is running?
>>
>> Cheers
>> Moritz
>>
>> Matthew Bauer <mjbauer95@gmail.com> writes:
>>
>> > 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".
>> >p
>> > 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.
>> >
>> > There are two main drawbacks: slow startup and large file size.
>> > Extracting the tarball takes time and this adds on to startup times.
>> > Also, because everything is included from the Nix closure, complicated
>> > apps tend to be much larger because of the dependency tree.
>> >
>> > I've been experimenting with using AppImage as a format to package
>> > them in, but it is not currently ready yet.
>> > _______________________________________________
>> > nix-dev mailing list
>> > nix-dev@lists.science.uu.nl
>> > http://lists.science.uu.nl/mailman/listinfo/nix-dev
>>
>> --
>>
>> _______________________________________________
>> nix-dev mailing list
>> nix-dev@lists.science.uu.nl
>> http://lists.science.uu.nl/mailman/listinfo/nix-dev
>>
>>
>
> _______________________________________________
> nix-dev mailing list
> nix-dev@lists.science.uu.nl
> http://lists.science.uu.nl/mailman/listinfo/nix-dev
>
>
--
Tomasz Czyż
[Attachment #5 (text/html)]
<div dir="ltr"><span style="font-size:12.8px;white-space:nowrap">Matthew, \
</span><br><div><span style="font-size:12.8px;white-space:nowrap">very good tool, \
thank you for sharing.</span></div></div><div class="gmail_extra"><br><div \
class="gmail_quote">2017-02-07 10:32 GMT+00:00 Domen Kožar <span dir="ltr"><<a \
href="mailto:domen@dev.si" \
target="_blank">domen@dev.si</a>></span>:<br><blockquote class="gmail_quote" \
style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div \
dir="ltr">Awesome! I will need this very soon, good timing :)</div><div \
class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div \
class="gmail_quote">On Tue, Feb 7, 2017 at 11:30 AM, Moritz Ulrich <span \
dir="ltr"><<a href="mailto:moritz@tarn-vedra.de" \
target="_blank">moritz@tarn-vedra.de</a>></span> wrote:<br><blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"><br> Hey Matthew,<br>
<br>
This sounds great! I'll give it a try :-)<br>
<br>
One question: Will it create a persistent /nix directory on the machine<br>
the generated binary is running?<br>
<br>
Cheers<br>
Moritz<br>
<span><br>
Matthew Bauer <<a href="mailto:mjbauer95@gmail.com" \
target="_blank">mjbauer95@gmail.com</a>> writes:<br> <br>
> GitHub page: <a href="https://github.com/matthewbauer/nix-bundle" \
rel="noreferrer" target="_blank">https://github.com/matthewbaue<wbr>r/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>
</span>>p<br>
<span>> 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>
> There are two main drawbacks: slow startup and large file size.<br>
> Extracting the tarball takes time and this adds on to startup times.<br>
> Also, because everything is included from the Nix closure, complicated<br>
> apps tend to be much larger because of the dependency tree.<br>
><br>
> I've been experimenting with using AppImage as a format to package<br>
> them in, but it is not currently ready yet.<br>
> ______________________________<wbr>_________________<br>
> nix-dev mailing list<br>
> <a href="mailto:nix-dev@lists.science.uu.nl" \
target="_blank">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/mai<wbr>lman/listinfo/nix-dev</a><br> <br>
</span>--<br>
<br>______________________________<wbr>_________________<br>
nix-dev mailing list<br>
<a href="mailto:nix-dev@lists.science.uu.nl" \
target="_blank">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/mai<wbr>lman/listinfo/nix-dev</a><br> \
<br></blockquote></div><br></div> \
</div></div><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><br><br clear="all"><div><br></div>-- <br><div \
class="gmail_signature" data-smartmail="gmail_signature">Tomasz Czyż</div> </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