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 { rec {
# mapFilterAttrs :: # mapFilterAttrs ::
# (name -> value -> bool ) # (name -> value -> bool )

View File

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

View File

@ -21,14 +21,17 @@
let callLibs = file: import file let callLibs = file: import file
({ ({
lib = final; 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); } // inputs);
in in
with final; with final;
let let
attrs = callLibs ./attrs.nix;
lists = callLibs ./lists.nix; attrs = import ./attrs.nix { lib = prev; };
strings = callLibs ./strings.nix; lists = import ./lists.nix { lib = prev; };
strings = import ./strings.nix { lib = prev; };
in in
utils.lib utils.lib
@ -38,7 +41,7 @@
{ {
inherit callLibs; inherit callLibs;
os = callLibs ./devos; os = import ./devos { lib = final; };
mkFlake = { mkFlake = {
__functor = callLibs ./mkFlake; __functor = callLibs ./mkFlake;
@ -46,7 +49,10 @@
evalOldArgs = callLibs ./mkFlake/evalOldArgs.nix; 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 inherit (attrs) mapFilterAttrs genAttrs' safeReadDir
pathsToImportedAttrs concatAttrs filterPackages; pathsToImportedAttrs concatAttrs filterPackages;

View File

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

View File

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

View File

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