Nix Portable: Nix - Static, Permissionless, Install-free, Pre-configured

AFAIK, the original nix supports two methods for re-locating the store.

  1. Recompiling nix with some flags, or setting the NIX_STORE_DIR. The problem with that is, that you will not be able to use the official cache, since all your stuff has to be linked against another store path.
  2. Using the --store flag when executing nix. That will behave similarly to nix-portable, but it requires user namespaces and won’t work on some distros where this is disabled.

Apart from that, nix-portable tries to ensure that nix really works out of the box. Using the original nix, you might need to install SSL certificates first, if you haven’t, then you have to setup your nix-channel, or write a nix configuration to enable flakes, etc. Nix-portable does all of that automatically. It doesn’t really depend on anything else than bash.

Thanks for mentioning them. Both of those projects require user namespaces, though.

1 Like