dream2nix
dream2nix copied to clipboard
integrate dream2nix with pyproject.toml
For single language use-cases it could be interesting to integrate dream2nix with pyproject.toml, so that the following workflow becomes possible:
Workflow
$ pip install dream2nix
$ dream2nix init
which will ensure nix is installed and modify the pyproject.toml to include the following
[build-system]
requires = ["dream2nix"]
Then enter the dev shell via:
dream2nix develop
Or build the project via
dream2nix build
... where the dream2nix executable is a simple wrapper around nix which imagines a flake.nix into existence before executing nix with the given "$@" args.
Customization
Instead of modifying a default.nix template, the nix build can be customized via the pyproject.toml
[tool.dream2nix]
mkDerivation.preBuild = ""
buildPythonPackage.pythonImportsCheck = ["my_tool"]
Could I propose dream instead of dream2nix as a cli? Having a number in the command name is very un-ergonomic
This would be amazing @DavHau