dotfiles/openwrt
2023-05-13 08:25:32 +02:00
..
bin add openwrt config 2022-05-01 09:43:52 +02:00
nix reformat with treefmt 2022-12-28 14:14:00 +01:00
nix_uci fix python lint errors 2022-12-28 14:41:52 +01:00
.envrc openwrt: switch to just 2022-05-08 14:38:29 +02:00
example.nix switch from ns2 back to ns1 2023-05-13 08:25:32 +02:00
flake.lock openwrt/flake.lock: Update 2023-04-07 13:43:49 +02:00
flake.nix reformat with treefmt 2022-12-28 14:14:00 +01:00
Justfile figure out latest openwrt release automatically 2022-10-28 09:31:58 +02:00
README.md openwrt: switch to just 2022-05-08 14:38:29 +02:00
secrets.yml openwrt add ddns 2022-05-07 07:32:25 +02:00
setup.cfg add openwrt config 2022-05-01 09:43:52 +02:00
setup.py add openwrt config 2022-05-01 09:43:52 +02:00

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