This commit is contained in:
2023-02-28 12:56:08 +00:00
parent 06da209722
commit d8394373ec
9 changed files with 197 additions and 98 deletions

View File

@@ -1,11 +1,33 @@
{
self,
platforms,
lib,
} @ args:
with {inherit (lib) makeExtensible attrValues foldr;};
(makeExtensible (final:
with final;
(import ./map.nix args).modules ./. (file: import file args)))
.extend
(final: prev: foldr (x: y: x // y) {} (attrValues prev))
# {lib}:
# lib.makeExtensible (self:
# let
# callLibs = file: import file { lib = self; };
# in
# rec {
# ## Define your own library functions here!
# #id = x: x;
# ## Or in files, containing functions that take {lib}
# map = callLibs ./map.nix;
# ## In configs, they can be used under "lib.our"
# })
{ inputs, lib, pkgs, ... }:
let
inherit (lib) makeExtensible attrValues foldr;
inherit (modules) mapModules;
# modules = import ./modules.nix {
# inherit lib;
# self.attrs = import ./attrs.nix { inherit lib; self = {}; };
# };
mylib = makeExtensible (self:
with self; mapModules ./.
(file: import file { inherit self lib pkgs inputs; }));
in
mylib.extend
(self: super:
foldr (a: b: a // b) {} (attrValues super))