Nix: know what you are running, testing and deploying
summary
Demonstrates a reproducible workflow that builds a minimal Flask app from a poetry.lock into a Nix derivation, produces a Docker image with only build-needed files and successfully runs the container, and runs pytest inside a Nix dev shell for CI. Uses poetry-to-nix to generate derivations, activates editable development via nix develop with direnv integration, and updates pinned inputs with flake update. Notes tradeoffs: learning Nix language and harder local debugging, plus friction with older package versions.
AI-written summary · about
chapters (16)
- 0:00Introduction to Nix
- 2:38Problems with current setup
- 5:27What is Nix
- 6:33Demo with Python project
- 9:52Building with Nix
- 10:12Understanding flake.nix
- 11:58Docker image with Nix
- 13:53Running Docker image
- 14:58Security benefits of Nix
- 16:01Nix development shells
- 18:40direnv integration
- 19:54Adding tests
- 21:40Setting up CI
- 23:38Why Nix over Docker
- 24:42Q&A begins
- 36:10Closing and thanks
