Dewclaw: semi-declarative openwrt configurations

ever wanted to have declarative openwrt configs? are you also not quite willing to wait until liminix is ready for any device that currently runs openwrt? have you looked at other solutions for this problem but found them lacking in some respect, like not having rollback mechanisms in place to not accidentally temp-brick a device by deploying a broken config to it?

then maybe dewclaw, a nix framework for generating openwrt configuration scripts, is for you.

at this point it’s functional but incomplete in many ways: all UCI configs can be represented but aren’t checked before deployment, user management and /etc management are very much limited in their capabilities, the scripts doing the deployment don’t natively support parallel deployment to many devices unless you’re happy to wrap them in a parallel command line, the list goes on. but it’s functional enough to deploy at least small hackerspace infra.

happy to hear thoughts. can’t provide any support, but figured other folks may be interested.

23 Likes

Love this! Will have a play when I get a chance!

Have you explored integrating this with @astro’s image builder? GitHub - astro/nix-openwrt-imagebuilder: Build OpenWRT images in Nix derivations

no. for running a system we’ve actively decided against using images because that makes trial booting a new configuration hard to impossible. extracting the UCI bits to make the image builder more comfortable should be reasonably easy though, the necessary configs are already exposed and could “just” be used in a image builder invocation.

(on a side note, we’re not very fond of the openwrt build process in general, regardless of the method used. we’ve tried to nixify it properly for a while and eventually just gave up, astro’s version seems to be the best nixified image builder setup that’s viable for now)

1 Like

I too would love to see that. Could you share the unfinished bits?

no, we deleted it all in anger. :frowning:

Thanks! I think updating a running system is important, but can also see value in building an image with an initial configuration. e.g. bootstrap a device with credentials and network settings.