By the way, I had a few reasons why I wrote nixos-rebuild-ng in Python that I think are related to this topic:
- Python is a language that is already used by other tools (e.g.:
systemd-boot-builder.py), so it is highly likely that any standard installation of NixOS will pull Python as a dependency anyway- For the few cases that it will not (e.g.: container images), I don’t except people will want
nixos-rebuildin it anyway
- For the few cases that it will not (e.g.: container images), I don’t except people will want
- Python has a good standard library (e.g.: there is a
jsonlibrary already that is pretty good,argparseto create CLI commands,subprocessto run other executables, etc.), that means it is less likely that I will need to pull third party dependencies, reducing the risk of breakages- Right now
nixos-rebuild-nghas only one external dependency intabulate, that technically is completely optional (I didn’t made it optional yet because lack of demand) and is only used by one specific command, and I don’t expect to need to add any other dependency until the end of the project
- Right now
- Good tooling:
mypyandruffare great to ensure that the code is correct (types and linting) and also ensuring that the code is formatted consistently (ruff formatorblack) - Reasonable easy to debug thanks to
breakpoint()