What is Nixpkgs preferred programming language?

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-rebuild in it anyway
  • Python has a good standard library (e.g.: there is a json library already that is pretty good, argparse to create CLI commands, subprocess to 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-ng has only one external dependency in tabulate, 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
  • Good tooling: mypy and ruff are great to ensure that the code is correct (types and linting) and also ensuring that the code is formatted consistently (ruff format or black)
  • Reasonable easy to debug thanks to breakpoint()
1 Like