ref: reduce exposure to callLibs

for clarity's sake, expose which function uses final and prev, so that
people can have a clearer understanding how they relate to each other
in terms of dependencies.

also a simple `{ lib = final; }` probably does not warrant a complete
callLibs obscurization.
This commit is contained in:
David Arnold 2021-04-17 21:29:45 -05:00
parent 9dca402914
commit be924bcb27
6 changed files with 17 additions and 11 deletions

View file

@ -1,4 +1,4 @@
{ lib, ... }:
{ lib }:
rec {
# mapFilterAttrs ::
# (name -> value -> bool )

View file

@ -1,4 +1,4 @@
{ lib, ... }:
{ lib }:
{
# pkgImport :: Nixpkgs -> Overlays -> System -> Pkgs
pkgImport = nixpkgs: overlays: system:

View file

@ -21,14 +21,17 @@
let callLibs = file: import file
({
lib = final;
userFlakeInputs = {}; # TODO: Erm, this must become a proper argument to mkFlake
userFlakeNixos = {};
userFlakeSelf = {};
userFlakeInputs = {}; # TODO: Erm, theese must become proper arguments to mkFlake
} // inputs);
in
with final;
let
attrs = callLibs ./attrs.nix;
lists = callLibs ./lists.nix;
strings = callLibs ./strings.nix;
attrs = import ./attrs.nix { lib = prev; };
lists = import ./lists.nix { lib = prev; };
strings = import ./strings.nix { lib = prev; };
in
utils.lib
@ -38,7 +41,7 @@
{
inherit callLibs;
os = callLibs ./devos;
os = import ./devos { lib = final; };
mkFlake = {
__functor = callLibs ./mkFlake;
@ -46,7 +49,10 @@
evalOldArgs = callLibs ./mkFlake/evalOldArgs.nix;
};
pkgs-lib = callLibs ./pkgs-lib;
pkgs-lib = import ./pkgs-lib {
lib = final;
inherit nixpkgs deploy devshell;
};
inherit (attrs) mapFilterAttrs genAttrs' safeReadDir
pathsToImportedAttrs concatAttrs filterPackages;

View file

@ -1,4 +1,4 @@
{ lib, ... }:
{ lib }:
{
pathsIn = dir:
let

View file

@ -1,4 +1,4 @@
args@{ lib, nixpkgs, ... }:
args@{ lib, nixpkgs, deploy, devshell }:
lib.genAttrs lib.defaultSystems (system:
lib.makeExtensible (final:
let

View file

@ -1,4 +1,4 @@
{ lib, ... }:
{ lib }:
{
# returns matching part of _regex_ _string_; null indicates failure.
rgxToString = regex: string: