I had a new discovery today in #nixpkgs. It turns out that it supports functions that have attributes defined in runtime. Previously I thought that to correctly define a python package I would have to generate nix source code and import it. It is because dependencies provided as parameters are spliced but those from other sets such as python.pkgs are not. That can result in issues during cross compilation.
setFunctionArgs allows me to generate the appropriate set of package names runtime. 🎉

With this discovery my #nixflake that simplify package creation for #python projects supports package overrides the same way as those in #nixpkgs. Thus dependencies declared in pyproject.toml are automatically included and overidable.

https://gitlab.com/Cynerd/flakepy

Karel Kočí / flakepy · GitLab

Nix Flake helper for Python projects driven by pyproject.toml.

GitLab