Python: maintaining requirements.nix and requirements.txt?


I’ve been experimenting with using nix to manage the development environment for a python-based web app. I initially generated a requirements.nix with pypi2nix but needed fairly significant manual updates to get everything sorted.

I’m pretty happy with how this works, but I’m leery of the potential for mistakes/divergence introduced by having separate authoritative definitions for packages installed in my personal dev environment and the production environment.

Does anyone have or know of good tooling/patterns for maintaining a single authoritative source?


I hope that pypi2nix will be able to cache results of single packages at some point. At the moment when a failure, one has to start from the beginning, which takes too much time on complex projects.


For what it’s worth, I have had good results to date using (which adds some useful helper functions on top of pip2nix (this one )

I’ve not worked with so cannot speak to it


Thanks for pointing out setup.nix. I’m not sure it will quite solve my immediate concern, but I can think of some other ways to put it to use.