.. | ||
bin | ||
nix | ||
nix_uci | ||
.envrc | ||
example.nix | ||
flake.lock | ||
flake.nix | ||
Justfile | ||
README.md | ||
secrets.yml | ||
setup.cfg | ||
setup.py |
Configure openwrt with nix
This module uses nixos modules to configure the openwrt uci configuration. The
resulting configuration is converted to a format that the uci batch
command
understands
(https://openwrt.org/docs/guide-user/base-system/uci#uci_dataobject_model). It
also supports the use of secrets, which are stored in an encrypted
sops file. Secrets are interpolated with the
following syntax: @secret_key_from_sops@
.
Example:
See example.nix, flake.nix and Justfile on how to use this project. Tipp: The justfile is read by this tool
State of this project
- Works for me™
- I use this code for my own router. I do not intend to support features that go beyond what I personally need. If you take up the idea and create a real project, let me know and I might switch to your project and contribute to your project.
Known bugs
- It is not possible to reliably delete all elements of a list section with uci
batch command. Currently, the code attempts to delete up to 10 list sections
and then create a new list:
00e178a095/openwrt/nix_uci/
init.py#L108