What does HackerNews think of nix-portable?
Nix - Static, Permissionless, Installation-free, Pre-configured
Yes, for cache hits to happen it has to be this way as far as I remember.
There is a project called nix-portable though that I've seen some HPC users report success with:
https://github.com/DavHau/nix-portable
> Applications packaged with Nix also require special treatment to run in Nix environment, with paths rewritten and binaries patched to support Nix filesystem structure instead of the traditional Linux one.
If you fully package it. If you use something like an buildFHSUserEnv[0] that's not true.
There is also nix-autobahn and nix-alien for automatically running foreign binaries on a more ad-hoc basis or to generate a starting point for packaging.
0: https://nixos.org/manual/nixpkgs/stable/#sec-fhs-environment...
I wonder if you took a look at some of the modifications done by portable-nix (https://github.com/DavHau/nix-portable), most important ones being:
a) Allowing user to choose the location of the nix folder (for example $HOME/.nix) by using bwrap or proot
b) Same binary for Win/Linux/OSX on x86_64 (Also see https://ahgamut.github.io/2022/07/27/ape-rust-example/)
And then, somewhat unrelated: c) Can it be used within NixOS as nix.package = ?