nix-shell --packages git
nix-shell --packages pythonPackages.ipython pythonPackages.numpy
nix-env -qaP
In a directory, which contains a shell.nix
file, simply run:
nix-shell
- Here is a simple example
- A C++ Cmake example
- Pin a nixpkgs version like this
- Define packages not in the official repository like this
- Override (python-)package versions already in the official repository like this
You can find other examples of files here:
To get a shell cleaned from all environment variables use:
nix-shell --pure
nix-shell -p atom --run "atom"
nix-shell --pure -p pythonPackages.jupyter pythonPackages.numpy --run jupyter-notebook
nix-shell -p ponysay --run "ponysay 'This is great.'"
To make a nix-shell persistent and avoid it being garbage collected do the following:
cd <YOURPROJECT>
mkdir gcroots
nix-shell ./shell.nix --pure --indirect --add-root gcroots/dep