I think each Nix configuration option has four meta-information to deal with:
-
architectures: which instruction set it belongs to, optional values are: [“x86_64”, “aarch64”, “risc-v”, …], etc.
-
systems: which operating system it belongs to, optional values are: [“linux”, “darwin”, “vm”, …]
-
clusters: which host clusters it belongs to, where cluster is a set of hosts with some common configurations (a cluster can be all hosts or a single physical machine)
-
groups: which user group it belongs to, where group is a set of users with some common configurations (a user group can be all users or a single user)
It can be said that a certain configuration is a user configuration in a certain cluster under a certain operating system under a certain instruction set.
But how should these meta-information be represented, using folders, files, configuration options, or other representation methods, I don’t have a good idea yet. I hope to write a framework to specifically represent this architecture. I referred to Snowfall’s organizational structure, but it seems that for something like “home-manager module that is applicable to all *-darwin
but not applicable to *-linux
”, I can’t find a suitable directory to store it. How can I implement this framework?