refactor(dotfiles): inline registry definitions #112
@@ -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/definitions.nix`
|
|
||||||
- [ ] `src/dotfiles/registry/schema.nix`
|
- [ ] `src/dotfiles/registry/schema.nix`
|
||||||
- [ ] `src/dotfiles/registry/collection.nix`
|
- [ ] `src/dotfiles/registry/collection.nix`
|
||||||
- [ ] `src/dotfiles/registry/validation.nix`
|
- [ ] `src/dotfiles/registry/validation.nix`
|
||||||
|
|||||||
@@ -5,9 +5,24 @@
|
|||||||
util,
|
util,
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
definitions = import ./registry/definitions.nix {
|
definitions = lib.genAttrs' (util.collectNixFiles root) (
|
||||||
inherit lib root util;
|
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
|
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