prev. article next article

running the nix package manager in a prefix as the home directory

21 Jan 2011


this posting is about how to setup a nix prefix installation on gentoo linux. if you do not have permission to install software on your server you can install a package manager in your home directory.

prefix distros:

gentoo prefix

nix prefix

nix prefix - setup

download the software from [2], then follow this guide:

tar xf nix-0.16.tar
cd nix-0.16
./configure --prefix=~/nix **--localstatedir**=~nix/state **--with-store-di**r=~/nix/store
make install

NOTE: –localstatedir is not visible when doing ./configure –help!

nix prefix - how to use

next you have to add it to your PATH, do:


export PATH=~/.nix-profile/bin:$PATH

NOTE: you have to do this every time you want to use your prefixed nix.

this will alter your path to use program you install using ‘nix-env’ as:

nix-env -i wget

this should download about 10-40 software components as gcc, binutils, libraries and finally wget. afterwards do:

which wget

which should report: ~/.nix-profile/bin/wget