mirror of
https://github.com/sstent/vmimages.git
synced 2025-12-06 06:01:51 +00:00
33 lines
789 B
Nix
33 lines
789 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)) |