nix-shell
will import default.nix
, bringing the app's dependencies (just flask) into scope, as well as setting FLASK_APP
:
~/nixos-flask-example ❯❯❯ nix-shell
Sourcing python-remove-tests-dir-hook
Sourcing python-catch-conflicts-hook.sh
Sourcing python-remove-bin-bytecode-hook.sh
Sourcing python-imports-check-hook.sh
Using pythonImportsCheckPhase
Sourcing python-namespaces-hook
[nix-shell:~/nixos-flask-example]$ flask run
* Serving Flask app "paste"
Add service.nix
to your NixOS configuration's imports
, and enable services.paste
.
This will run the package from default.nix
under waitress-serve.
nix-build test.nix