From 54335ead826078d02b07c52e0261729237ba32fd Mon Sep 17 00:00:00 2001 From: alexion Date: Tue, 29 Sep 2026 20:16:15 -0400 Subject: [PATCH] refactor(dotfiles): inline registry definitions --- docs/TODO.md | 1 - src/dotfiles/registry.nix | 21 ++++++++++++++++++--- src/dotfiles/registry/definitions.nix | 26 -------------------------- 3 files changed, 18 insertions(+), 30 deletions(-) delete mode 100644 src/dotfiles/registry/definitions.nix diff --git a/docs/TODO.md b/docs/TODO.md index 38fbeb0..ad2fe4b 100644 --- a/docs/TODO.md +++ b/docs/TODO.md @@ -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` diff --git a/src/dotfiles/registry.nix b/src/dotfiles/registry.nix index 4ee3b0d..47b0733 100644 --- a/src/dotfiles/registry.nix +++ b/src/dotfiles/registry.nix @@ -5,9 +5,24 @@ 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 { diff --git a/src/dotfiles/registry/definitions.nix b/src/dotfiles/registry/definitions.nix deleted file mode 100644 index f2b2c40..0000000 --- a/src/dotfiles/registry/definitions.nix +++ /dev/null @@ -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 -- 2.47.3