Example files around pip2nix
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
devpi
lektor
matrix-synapse
pelican
.gitignore
README.rst
default.nix

README.rst

Generated Nix environments for various things

Mainly used as a collection of environments which are generated by pip2nix.

I do use these files to experiment with pip2nix and also to have some tools at my fingertips whenever I need them. Please only use this for anything except experimentation if you understand what you are doing.

Usage

Using existing things should work via the normal Nix tooling, e.g. nix-shell or nix-build and nix-env. See the Nix manual regarding more details and the full background.

Example to spin up a shell with devpi-server being available:

$ cd devpi
$ nix-shell
$ devpi-server --version
4.2.1

Updates

Some tools are needed to make updates a bit easier to handle, e.g. to update some packages in the requirements lists or to generate the nix expressions again.

After running nix-shell in the root folder, the following tools are available:

pip-compile

Allows to "compile" a requirements.in into a requirements.txt, so that every requirement is pinned to an exact version.

This does help in the process when specific tweaks are needed and one wants to avoid that pip2nix would update too many things.

pip2nix
This will pick up the requirements.txt and generate a bunch of Nix code which can be used as a layer to build the Python packages.

Example for devpi

Start in the root folder of this repository:

$ nix-shell

Once inside of the shell, change into the devpi directory and let the tools work for you:

$ pip-compile
$ pip2nix generate

Note that pip-compile depends on a file requirements.in being there and pip2nix depends on a configuration file pip2nix.ini being present.

Contact

Johannes Bornhold, details via https://www.johbo.com