nix-config/lib/default.nix
Bruno BELANYI e5b82f0902
All checks were successful
continuous-integration/drone/push Build is passing
lib: fix formatting
2022-06-22 16:06:58 +02:00

19 lines
543 B
Nix

# 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:
mapModules ./. (file: import file { inherit self lib pkgs inputs; })
);
in
mylib.extend (self: super: foldr (a: b: a // b) { } (attrValues super))