refactor(dotfiles): inline registry options
This commit was merged in pull request #111.
This commit is contained in:
@@ -128,7 +128,6 @@ Review Nix files in entrypoint order:
|
|||||||
- [x] `src/dotfiles/default.nix`
|
- [x] `src/dotfiles/default.nix`
|
||||||
- [x] `src/dotfiles/util.nix`
|
- [x] `src/dotfiles/util.nix`
|
||||||
- [ ] `src/dotfiles/registry.nix`
|
- [ ] `src/dotfiles/registry.nix`
|
||||||
- [ ] `src/dotfiles/registry/options.nix`
|
|
||||||
- [ ] `src/dotfiles/registry/definitions.nix`
|
- [ ] `src/dotfiles/registry/definitions.nix`
|
||||||
- [ ] `src/dotfiles/registry/schema.nix`
|
- [ ] `src/dotfiles/registry/schema.nix`
|
||||||
- [ ] `src/dotfiles/registry/collection.nix`
|
- [ ] `src/dotfiles/registry/collection.nix`
|
||||||
|
|||||||
@@ -5,17 +5,26 @@
|
|||||||
util,
|
util,
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
options = import ./registry/options.nix {
|
|
||||||
inherit definitions lib;
|
|
||||||
};
|
|
||||||
|
|
||||||
definitions = import ./registry/definitions.nix {
|
definitions = import ./registry/definitions.nix {
|
||||||
inherit lib root util;
|
inherit lib root util;
|
||||||
};
|
};
|
||||||
|
|
||||||
in
|
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 {
|
collected = import ./registry/collection.nix {
|
||||||
inherit definitions hosts lib;
|
inherit definitions hosts lib;
|
||||||
|
|||||||
@@ -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;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user