From 16c69e01e1cd0b0b7c1db0553579048d490a2679 Mon Sep 17 00:00:00 2001 From: alexion Date: Tue, 29 Sep 2026 00:27:15 -0400 Subject: [PATCH] refactor(dotfiles): inline registry options --- docs/TODO.md | 1 - src/dotfiles/registry.nix | 19 ++++++++++++++----- src/dotfiles/registry/options.nix | 22 ---------------------- 3 files changed, 14 insertions(+), 28 deletions(-) delete mode 100644 src/dotfiles/registry/options.nix diff --git a/docs/TODO.md b/docs/TODO.md index 33b0b72..38fbeb0 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/options.nix` - [ ] `src/dotfiles/registry/definitions.nix` - [ ] `src/dotfiles/registry/schema.nix` - [ ] `src/dotfiles/registry/collection.nix` diff --git a/src/dotfiles/registry.nix b/src/dotfiles/registry.nix index 91df9c5..4ee3b0d 100644 --- a/src/dotfiles/registry.nix +++ b/src/dotfiles/registry.nix @@ -5,17 +5,26 @@ util, }: let - options = import ./registry/options.nix { - inherit definitions lib; - }; - definitions = import ./registry/definitions.nix { inherit lib root util; }; in { - inherit (options) types module; + types = lib.mapAttrs (_name: definition: definition.type) definitions; + + module = { + options.registry = lib.mapAttrs ( + _name: registry: + lib.mkOption { + type = lib.types.attrsOf (lib.types.attrsOf registry.type); + default = { }; + description = '' + Lazily collected fleet-visible registry entries, nested by host and entry name. + ''; + } + ) definitions; + }; collected = import ./registry/collection.nix { inherit definitions hosts lib; diff --git a/src/dotfiles/registry/options.nix b/src/dotfiles/registry/options.nix deleted file mode 100644 index 021b13f..0000000 --- a/src/dotfiles/registry/options.nix +++ /dev/null @@ -1,22 +0,0 @@ -{ - definitions, - lib, -}: -let - registryOption = - registry: - lib.mkOption { - type = lib.types.attrsOf (lib.types.attrsOf registry.type); - default = { }; - description = '' - Lazily collected fleet-visible registry entries, nested by host and entry name. - ''; - }; -in -{ - types = lib.mapAttrs (_name: definition: definition.type) definitions; - - module = { - options.registry = lib.mapAttrs (_name: registryOption) definitions; - }; -} -- 2.47.3