Skip to content

jokatzke/nix-flake-python-example

 
 

Repository files navigation

Nix Flake Python Example

TODO

  • Checks:
    • black
    • flake8
    • isort
    • mypy
    • pytest

Requires

  • nix
  • direnv

Or without nix using virtualenv:

  • python39
  • virtualenv

Usage

Run:

nix run . -- --example foo --example bar

Shell:

nix develop

Shell using direnv:

direnv allow .

Run from shell:

python src/mypackage/__init__py --example foo --example bar

Build and run prod:

nix build
./result/bin/mypackage

Usage without Nix using virtualenv

Setup:

source ./scripts/venv

Run:

mypackage

Setup with fresh virtualenv:

source ./scripts/venv true

Update

Update flake, rebuild requirements.txt and requirements-dev.txt:

./scripts/update

About

Example of a nix flake for a Python project

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Nix 57.8%
  • Shell 22.9%
  • Python 19.3%