mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 20:39:18 -08:00
...Everything can be a specialArg. Anything can be hidden in trusted.
This commit is contained in:
parent
3c9475cdcf
commit
361216c859
5 changed files with 67 additions and 35 deletions
|
|
@ -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
|
||||
|
|
|
|||
7
pkgs/lib/domain-merge.nix
Normal file
7
pkgs/lib/domain-merge.nix
Normal 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
|
||||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue