added stuff
This commit is contained in:
parent
6d31f5b5a1
commit
7d4f626b7d
907 changed files with 70990 additions and 0 deletions
23
nyx/lib/core.nix
Normal file
23
nyx/lib/core.nix
Normal file
|
@ -0,0 +1,23 @@
|
|||
{lib}: let
|
||||
inherit (lib) recursiveUpdate;
|
||||
|
||||
# the below function is by far the most cursed I've put in my configuration
|
||||
# if you are, for whatever reason, copying my configuration - PLEASE omit this
|
||||
# and do your imports manually
|
||||
# credits go to @nrabulinski
|
||||
import' = path: let
|
||||
func = import path;
|
||||
args = lib.functionArgs func;
|
||||
requiredArgs = lib.filterAttrs (_: val: !val) args;
|
||||
defaultArgs = (lib.mapAttrs (_: _: null) requiredArgs) // {inherit lib;};
|
||||
functor = {__functor = _: attrs: func (defaultArgs // attrs);};
|
||||
in
|
||||
(func defaultArgs) // functor;
|
||||
|
||||
# recursively merges two attribute sets
|
||||
# it is used to convert the importedLibs list into an attrset
|
||||
# there is probably a better way to do it, more cleanly - but I wouldn't know
|
||||
mergeRecursively = lhs: rhs: recursiveUpdate lhs rhs;
|
||||
in {
|
||||
inherit import' mergeRecursively;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue