{ npins ? import ../npins, lib ? import "${(import ../npins).nixpkgs}/lib", ... }: let # read the current directorys files and pipe the result through a list of functions overlays = builtins.foldl' (x: f: f x) (builtins.readDir ./.) [ # convert to a list containing just the attribute names (builtins.attrNames) # drop "default.nix" from the list (builtins.filter (name: name != "default.nix")) # map the list to a name-value pair with a name that has the last 4 chars (".nix") stripped, and a value that is the contents of that given file (builtins.map (name: { inherit name; value = import ./${name} { inherit npins; }; })) # convert the resulting list to an attribute set (builtins.listToAttrs) ]; in overlays // { default = lib.flatten (builtins.attrValues overlays); }