constitution ammendment
This commit is contained in:
@@ -21,6 +21,7 @@
|
||||
- Minimize comments; prefer clear naming and shared helpers (`modules/factories/mkserver.nix`, `modules/factories/mkscript.nix`) to avoid duplication.
|
||||
- Use business-level, technology-agnostic language in AI docs; reserve implementation detail for module code.
|
||||
- Nix structure: flatten single-child attribute sets into their full path; keep multi-child sets nested for readability; merge siblings under a shared parent; flatten the shallowest subtree first to reduce indentation without losing clarity.
|
||||
- Nix attribute ordering: prefer `options` before `config` in module bodies; inside attribute sets keep `inherit` statements first, then boolean leaf assignments, then other leaf assignments, then nested attribute sets; when simple leaves and nested children share a parent, place the simple leaves first.
|
||||
```nix
|
||||
config.services.jellyfin.enable = true; # preferred single-leaf form
|
||||
config.services = {
|
||||
@@ -31,6 +32,20 @@ config.services = {
|
||||
};
|
||||
};
|
||||
```
|
||||
```nix
|
||||
{
|
||||
options.my.example.enable = lib.mkEnableOption "example";
|
||||
config = lib.mkIf config.my.example.enable {
|
||||
services.example = {
|
||||
enable = true;
|
||||
port = 1234;
|
||||
nested = {
|
||||
value = "x";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
```
|
||||
|
||||
## Terminology and Naming Standards
|
||||
- Module: Prefer a feature directory under `modules/<category>/<name>/` with `nixos.nix` for system concerns and `home.nix` for Home Manager concerns. Legacy flat modules at `modules/<category>/<name>.nix` remain valid during migration.
|
||||
|
||||
Reference in New Issue
Block a user