What does HackerNews think of nix-portable?

Nix - Static, Permissionless, Installation-free, Pre-configured

Language: Nix

#10 in npm
> It requires a unique installation process to be available for users, because it wants to manage its store at the root level (/nix/store/)

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...

Great work Graham and team, I'll be switching to it on OSX.

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 = ?
Not entirely true, there are many ways in which you can use a custom location and still take advantage of the binary cache. You can do it with chroot, file system namespaces, bind mounts and so on. There's also a nice user friendly tool that does exactly this [1].

[1]: https://github.com/DavHau/nix-portable