Open tomeon opened 1 year ago
In general, great idea! I already use the NixOS module system for networking configuration.
However, this piece of code already has a few ways of calling it. I prefer the managability and flexibility of putting lib.evalModules
in my own code, passing the nix-openwrt-imagebuilder parameters together in one place. Are there use-cases where doing so would be inconvenient?
To me it starts to make sense if we start defining all the OpenWRT options as sensible NixOS module options. @ehmry launched a fork into this direction starting in #9. Although it would be nice to have, I am not sure I am ready to maintain and update such a bulk of declarations. Can it be automated just like I've done with the download hashes?
I'm not working with OpenWRT anymore so I'm not maintain my module fork. As I recall @mic92 has similar configuration work that is relevant.
There is also https://git.eno.space/dewclaw.git/tree/ now.
Hey, @tomeon! I noticed that your sourcehut repository is active and that you have implemented a very comprehensive module system, including the flake-parts module ❤️. Are you still interested in creating a PR to port it to this repository? 👀
I believe everyone would benefit from a more modular system that allows for atomic changes, better type-safety, and auto-generated documentation similar to NixOS modules.
Regarding @astro's comment:
Although it would be nice to have, I am not sure I am ready to maintain and update such a bulk of declarations.
I think @tomeon's approach to modules is simpler and easier to maintain than what was proposed in https://github.com/astro/nix-openwrt-imagebuilder/pull/9. While it would be great to have many individual services wrapped into Nix expressions like NixOS service modules, I agree that it would be hard to maintain.
In my opinion, wrapping UCI expressions into NIX and exposing packages
, disabledServices
, and files
makes more sense, as it aligns more closely with what is already implemented in this repository and with ImageBuilder's interface.
Hello, and thanks for this neat and useful toolchain. I'm trying to do a better job of managing my OpenWRT-based router and APs, and as a confirmed Nixaholic this repository is just what I needed.
Would you be interested in a PR introducing a modular interface to the OpenWRT image builder code? I have a (very) rough cut at such an interface up on SourceHut here.
The high-level view:
If specified as a flake output, the image and associated assets could then be built with
nix build '.#openwrtImages.default.config.system.build.image'
. I plan to add a wrapper command for this that would permit doing, say,nix-openwrt-imagebuild '.#default'
.Any interest in integrating something like this in your project?
Thank you!