Turning BIRD configuration language into NixOS modules through lexer and parser specifications
In 2025, a presentation was given on utilizing NixOS machines as border routers with Internet scale routing capabilities. Similar attempts were made at NixCon 26, which were well-received. The presenter heavily relied on BIRD, a configuration language used for routing daemons, web servers, and more. However, manually inputting options proved to be cumbersome and resulted in very large files.
Over the weekend, the presenter contemplated whether it would be possible to leverage BIRD's parser/lexer generation to programmatically annotate config production rules. This would enable the conversion of complex type names into user-friendly NixOS module type declarations with 100% accuracy. The presenter examined options such as NixOS Router, a simple and fast static-page search engine for NixOS options and packages.
The concept was initially coded for fun but had the potential to be production-ready for those who prefer a more streamlined approach.
Rewritten by urgent.news; may contain errors — check the original. How we use AI.
Source: discourse.nixos.org