2021-03-10 19:49:12 +01:00
|
|
|
# Extension mechanism shamelessly stolen from [1].
|
|
|
|
#
|
|
|
|
# [1]: https://github.com/hlissner/dotfiles/blob/master/lib/default.nix
|
|
|
|
{ lib, pkgs, inputs }:
|
|
|
|
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:
|
2021-09-24 00:57:46 +02:00
|
|
|
mapModules ./. (file: import file { inherit self lib pkgs inputs; })
|
2021-03-10 19:49:12 +01:00
|
|
|
);
|
|
|
|
in
|
2023-05-03 16:48:36 +02:00
|
|
|
mylib.extend (_self: super: foldr (a: b: a // b) { } (attrValues super))
|