This method of using Nix has some upfront cost. This is because https://matthewbauer.us/nix must be downloaded each time and the embedded .tar.gz file extracted. If you want Nix to stay around permanently, you have to follow a few tricks. Total install size is about 11M. Using this method, you will reduce startup and keep Nix in your path at each login.

I have two ways of doing this. One the “easy” way is just running this script.

$ curl https://matthewbauer.us/nix.sh | sh

The other is the "safe" way and involves running some commands in order. These are the same commands run by the script, but this lets you audit everything being done line by line.

$ t =$(mktemp -d) $ curl https://matthewbauer.us/nix > $ t /nix.sh $ ( cd $ t && sh nix.sh --extract) $ mkdir -p $ HOME /bin/ $ HOME /share/nix/corepkgs/ $ mv $ t /dat/nix $ HOME /bin/ $ mv $ t /dat/share/nix/corepkgs/* $ HOME /share/nix/corepkgs/ $ echo export 'PATH=$HOME/bin:$PATH' >> $ HOME /.profile $ echo export 'NIX_DATA_DIR=$HOME/share' >> $ HOME /.profile $ source $ HOME /.profile $ rm -rf $ t