nix-config/lib/default.nix
Bruno BELANYI a868088cc9 treewide: rename unused overlay arguments
Now that `nix flake check` doesn't complain about it anymore, try to be
consistent about using that feature.
2023-05-03 15:15:31 +00:00

19 lines
544 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))