refactor(dotfiles): inline registry definitions
This commit was merged in pull request #112.
This commit is contained in:
@@ -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`
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user