mirror of
https://github.com/sstent/vmimages.git
synced 2026-01-25 22:51:49 +00:00
38 lines
784 B
Nix
38 lines
784 B
Nix
# {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))
|