...Everything can be a specialArg. Anything can be hidden in trusted.

This commit is contained in:
kat witch 2021-08-07 01:04:37 +01:00
parent 3c9475cdcf
commit 361216c859
No known key found for this signature in database
GPG key ID: 1B477797DCA5EC72
5 changed files with 67 additions and 35 deletions

View file

@ -12,6 +12,7 @@
{
inherit (colorHelpers) hextorgba;
hostImport = import ./host-import.nix { inherit lib; };
domainMerge = import ./domain-merge.nix { inherit lib; };
modListMerge = import ./intersect-merge.nix { inherit lib; };
modList = import ./module-list.nix { inherit lib; };
}; in katlib

View file

@ -0,0 +1,7 @@
{ lib }: { folder, defaultFile ? "default.nix" }: with lib; let
folderNames = [ (../../config + "/${folder}") (../../config/trusted + "/${folder}") ];
folderModLists = map (folderName: modList {
modulesDir = folderName;
inherit defaultFile;
}) (filter builtins.pathExists folderNames);
in foldl modListMerge { } folderModLists

View file

@ -12,7 +12,7 @@ let
directories =
filterAttrNamesToList (_: type: type == "directory") (readDir modulesDir);
files = map (dir: nameValuePair dir (modulesDir + "/${dir}/${defaultFile}"))
directories;
(filter (f: builtins.pathExists (modulesDir + "/${f}/${defaultFile}")) directories);
modules = map
({ name, value }:
# if the file contains a function, assume it to be a module and pass the path