Nix Installation¶
FiPy now has a Nix expression for installing FiPy using Nix. Nix is a powerful package manager for Linux and other Unix systems that makes package management reliable and reproducible. The recipe works on both Linux and Mac OS X.
Getting Started with Nix¶
There are a number of tutorials on getting started with Nix. The page that I used when getting started is on the Blog of the HPC team of GRICAD,
https://gricad.github.io/calcul/nix/tuto/2017/07/04/nix-tutorial.html
I also made my own notes,
https://github.com/wd15/nixes/blob/master/NIX-NOTES.md
which are a succinct steps that I use when setting up a new system with Nix.
Installing¶
Once you have a working Nix installation use:
$ nix-shell --pure
in the base FiPy directory to install FiPy with Python
3 by default. Modify the shell.nix file to use another version of
Python. nix-shell
drops the user into a shell with a working
version of FiPy. To test your installation use:
$ nix-shell --pure --command "python setup.py test"
Additional Packages¶
To install additional packages available from Nixpkgs include them in the nativeBuildInputs list in shell.nix.
Using Pip¶
Packages unavailable from Nix can be installed using Pip. In
this case, the installation has been set up so that the Nix shell
knows about a .local
directory in the base FiPy directory
used by Pip for installation. So, for example, to install the
toolz
package from within the Nix shell use:
$ python -m pip install --user toolz
The .local
directory will persist after the Nix shell has been
closed.