Nix Portable
Finally I feel this is ready for kick off.
Contributions / Ideas / Discussions are welcome.
Nix as a static executable which works without previous installation/configuration and without super user privileges or user namespaces.
For binary downlaods, see: Releases · DavHau/nix-portable · GitHub
Design Goals:
- make it extremely simple to install nix
- make nix work in restricted environments (containers, HPC, …)
- be able to use the official binary cache (by simulating the /nix/store)
- make it easy to distribute nix (via other package managers)
Systems confirmed working (Please add yours via PR):
- CentOS 7
- Debian (in docker)
- NixOS
Under the hood:
- the nix-portable binary is a self extracting archive, caching its contents under $HOME/.nix-portable
- either bublewrap (bwrap) or proot is used to simulate the /nix/store directory which actually resides in $HOME/.nix-portable/store
- a default nixpkgs channel is included and the NIX_PATH variable is set accordingly.
- nix version 2.4 is used and configured to enable
flakes
andnix-command
out of the box.
Missing Features:
- managing nix profiles via
nix-env
- managing nix channels via
nix-channel
- MacOS
- support other architecutres than x86_64
Container Runtimes
To simulate the /nix/store and a few other directories, nix-portable supports the following container runtimes.
- bwrap (existing installation)
- bwrap (shipped via nix-portable)
- proot (existing installation)
- proot (shipped via nix-portable)
bwrap is preferred over proot and existing installations are preferred over the nix-portable included binaries.
nix-portable will try to figure out which runtime is best for your system.