# What is Nixpkgs preferred programming language?

**URL:** https://discourse.nixos.org/t/what-is-nixpkgs-preferred-programming-language/53848
**Category:** Documentation
**Created:** [October 3, 2024, 1:11pm UTC](https://discourse.nixos.org/t/what-is-nixpkgs-preferred-programming-language/53848 "2024-10-03T13:11:34Z")
**Posts on this page:** 1
**Showing post:** 49

<div class="post-metadata">

### Author: ![k0kada](https://discourse.nixos.org/user_avatar/discourse.nixos.org/k0kada/32/12502_2.png) [@k0kada](https://discourse.nixos.org/u/k0kada)
#### Post date: [November 25, 2024, 4:30pm UTC](https://discourse.nixos.org/t/what-is-nixpkgs-preferred-programming-language/53848/49 "2024-11-25T16:30:36Z")

</div>

By the way, I had a few reasons why I wrote [`nixos-rebuild-ng`](https://discourse.nixos.org/t/nixos-rebuild-ng-a-nixos-rebuild-rewrite/55606) 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`](https://pypi.org/project/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()`

---

_[View the full topic](https://discourse.nixos.org/t/what-is-nixpkgs-preferred-programming-language/53848)._
