Standardise nix/ directory structure: configuration and partition conventions
Problem
The nix/ directory structure is currently inconsistent across repositories:
- Some repos use
nix/configuration.nixas a monolithic config file - Some repos use
nix/dev.nixat the top level for the dev partition - There is no clear convention for when to split
nix/configuration.nixintonix/configuration/*.nix
Proposal
Standardise two conventions:
1. Partition modules: nix/partitions/dev.nix
Instead of nix/dev.nix, use nix/partitions/dev.nix. This is more descriptive and scales if additional partitions are introduced.
2. Configuration: nix/configuration.nix vs nix/configuration/*.nix
- For simple repos with a few config items:
nix/configuration.nix(single file) - When there are multiple semantic concerns: split into
nix/configuration/directory
Open question: At what threshold should configuration be split into multiple files? What are the guiding principles?
Questions for the team
-
@fancypants — From a theoretical/design perspective: at what threshold should
nix/configuration.nixbe split intonix/configuration/*.nix? What principle should guide this decision (number of concerns? lines of code? semantic independence?) -
@smartypants — Implementation feasibility: does
nix/partitions/dev.nixwork cleanly with import-tree andmkPartitionModule? - @locallycompact — Final call on the convention once we have input.
Context
Raised by @locallycompact during review of ongoing Nixica Unification 1.0 migrations. Currently in-flight MRs (ghc-common-hadrian!8, agent-roster!1) use different patterns.