Skip to content
This repository has been archived by the owner on May 30, 2019. It is now read-only.

Latest commit

 

History

History

nix-shell

Starting shells with --packages (or -p)

nix-shell --packages git
nix-shell --packages pythonPackages.ipython pythonPackages.numpy

List which packages are available

nix-env -qaP

Starting shells with a shell.nix file

In a directory, which contains a shell.nix file, simply run:

nix-shell 

You can find other examples of files here:

Starting a pure shell via --pure

To get a shell cleaned from all environment variables use:

nix-shell --pure

Running a command via --run

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.'"

Keep a nix-shell from being garbage collected

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