TLDR; I’m integrating more and more heterogeneous hardware from within a single repository, so:
- I split up modules into universal, shared and platform-specific pieces
- long time ago i wrote a custom thing to pass down into NixOS
specialArgsas akdnargument to integrate Raspberry Pi 4 hardware modules and differentiate NixOS installer iso from the rest of the modules,- I’m using it mostly for conditional
import, so everything is optionally included as much as possible (I’m otherwise hiding everything behind*.enableflags in my own modules) - I was stuck with “infinite recursion” error on
brivmachine that I finally got to solve
- I’m using it mostly for conditional
- rewrote “the custom thing” into a module (in the commit)
- I preserved the interface to limit the number of changes while solving the infinite recursion error
- I’ll refactor/strip it down sometime in the next 50 years

I have some vague ideas in the back of my head (some for years) to improve the stuff:
- the whole “folder-by-platform” is a disaster for navigating the related code, I would either:
- fold it back to a single folder, while using
<platform>.nixin role ofdefault.nix - integrate the
metamodule more deeply with conditional (optionalAttrs/mkIf) configs withindefault.nix(or any other module).
- fold it back to a single folder, while using
- I’m thinking about pulling the
modules/shared/universalintomodules/meta, to define “what I need” separately from the implementation and make the boundary (painfully) obvious
What do you think about such setup? Any thought on maintainability and extendability of it?