Nix can do this for basically anything - even python scripts with all their dependency modules, binary extensions and all dynamic lib dependencies, packed up into a single .nar file.<p>nix-shell can even be used as a shebang-line for scripts: <a href="https://nixos.org/manual/nix/stable/#use-as-a-interpreter" rel="nofollow">https://nixos.org/manual/nix/stable/#use-as-a-interpreter</a>
<p><pre><code> That is, given a shared library or a position independent
executable (PIE), it returns a single, self-contained file
packing all dependencies.
[...]
but closures do allow for deploying to other machines without
concerns about missing dependencies.
</code></pre>
So. It's a statically linked binary, but worse? Or like a PAR file, but for C? I'm really not sure what the benefits are here over statically linked binaries.<p>In fact, since it extracts to a directory in /tmp, it seems to be worse in comparison -- since you have to take the increase in size into account.<p>I really do not see what the point of this is, or what niche it's supposed to fill over flatpaks or appimages (which both have sandboxing), or why you would pick this over static libraries -- can someone explain this?
How is this different from prelink?<p><a href="https://linux.die.net/man/8/prelink" rel="nofollow">https://linux.die.net/man/8/prelink</a>