clan-config: move jsonschema lib to clanLib

This commit is contained in:
DavHau
2023-08-09 12:10:27 +02:00
parent 6b71f0c75e
commit 9438a9eb5f
6 changed files with 22 additions and 20 deletions

View File

@@ -1,17 +1,16 @@
{ lib, ... }:
let
clanLib = {
findNixFiles = folder:
lib.mapAttrs'
(name: type:
if
type == "directory"
then
lib.nameValuePair name "${folder}/${name}"
else
lib.nameValuePair (lib.removeSuffix ".nix" name) "${folder}/${name}"
)
(builtins.readDir folder);
};
in
clanLib
{
findNixFiles = folder:
lib.mapAttrs'
(name: type:
if
type == "directory"
then
lib.nameValuePair name "${folder}/${name}"
else
lib.nameValuePair (lib.removeSuffix ".nix" name) "${folder}/${name}"
)
(builtins.readDir folder);
jsonschema = import ./jsonschema.nix { inherit lib; };
}