refactor(dotfiles): inline registry definitions #112

Merged
alexion merged 1 commits from refactor/inline-registry-definitions into main 2026-09-29 20:19:10 -04:00
3 changed files with 18 additions and 30 deletions

View File

@@ -128,7 +128,6 @@ Review Nix files in entrypoint order:
- [x] `src/dotfiles/default.nix`
- [x] `src/dotfiles/util.nix`
- [ ] `src/dotfiles/registry.nix`
- [ ] `src/dotfiles/registry/definitions.nix`
- [ ] `src/dotfiles/registry/schema.nix`
- [ ] `src/dotfiles/registry/collection.nix`
- [ ] `src/dotfiles/registry/validation.nix`

View File

@@ -5,8 +5,23 @@
util,
}:
let
definitions = import ./registry/definitions.nix {
inherit lib root util;
definitions = lib.genAttrs' (util.collectNixFiles root) (
path: lib.nameValuePair (util.removeNixSuffix path) (mkRegistry path)
);
mkRegistry =
path:
let
evaluated = lib.evalModules {
specialArgs = { inherit util; };
modules = [
(import ./registry/schema.nix { inherit lib; })
path
];
};
in
{
inherit (evaluated.config) type replicate checks;
};
in

View File

@@ -1,26 +0,0 @@
{
lib,
root,
util,
}:
let
definitions = lib.genAttrs' (util.collectNixFiles root) (
path: lib.nameValuePair (util.removeNixSuffix path) (mkRegistry path)
);
mkRegistry =
path:
let
evaluated = lib.evalModules {
specialArgs = { inherit util; };
modules = [
(import ./schema.nix { inherit lib; })
path
];
};
in
{
inherit (evaluated.config) type replicate checks;
};
in
definitions