documentation regarding the new core functions

This commit is contained in:
Danilo Reyes
2026-03-16 15:50:14 -06:00
parent 28c8db6cb7
commit 4f4c23d1df
4 changed files with 17 additions and 1 deletions

View File

@@ -8,12 +8,13 @@
1. Create `modules/<category>/<name>/nixos.nix` for NixOS-only concerns such as `users.users`, `environment.systemPackages`, `services.*`, `programs.*`, firewall rules, and SOPS-backed system resources.
2. Create `modules/<category>/<name>/home.nix` for Home Manager concerns such as `programs.*`, `xdg.*`, `home.file.*`, `services.*` within Home Manager, and per-user shell aliases/config files.
3. Keep the toggle namespace aligned across both files so the same feature name remains recognizable. During migration, duplicate the option schema if needed rather than keeping Home Manager logic embedded in the NixOS module.
4. If the feature has truly shared logic, extract it into a local helper file within the feature directory or promote it into `modules/factories/` when reused across features.
4. If the feature has truly shared logic, extract it into a local helper file within the feature directory. If the same Home Manager wrapper pattern repeats across multiple features, promote that wrapper logic into `parts/core.nix` helpers instead of cloning the same `osConfig` and shell-selection code.
5. Remove the legacy flat module only after the paired files evaluate cleanly and all references are updated.
- Validation:
- `modules/modules.nix` discovers the features `nixos.nix`.
- `config/base.nix` registers `modules/home-manager.nix` in `home-manager.sharedModules`, and that loader discovers the features `home.nix`.
- System-only settings no longer reference `home-manager.users.*`.
- Home Manager settings no longer depend on `osConfig` unless that coupling is intentional and documented.
- Repeated HM wrapper logic uses shared helpers from `parts/core.nix` instead of being copied between modules.
- Outputs: Split module directory, retained toggle shape, and updated docs if the feature introduces new structure patterns.
- References: `docs/constitution.md` (Repository Overview, Terminology and Naming Standards, Maintenance Triggers), `docs/reference/index.md` (Module Directories, Auto-Import Rules)