lib: remove top-level `with lib`

This commit is contained in:
Thiago Kenji Okada 2021-10-27 08:58:56 -03:00 committed by Robert Helgesson
parent 71902bc913
commit 3ccddfc48d
No known key found for this signature in database
GPG Key ID: 36BDAA14C2797E89
10 changed files with 23 additions and 24 deletions

View File

@ -9,9 +9,8 @@
{ lib }: { lib }:
with lib; let inherit (lib) all any filterAttrs mapAttrs mapAttrsToList toposort;
in rec {
rec {
emptyDag = { }; emptyDag = { };

View File

@ -1,7 +1,8 @@
{ homeDirectory, lib, pkgs }: { homeDirectory, lib, pkgs }:
with lib; let
inherit (lib) hasPrefix hm literalExpression mkDefault mkIf mkOption removePrefix types;
in
{ {
# Constructs a type suitable for a `home.file` like option. The # Constructs a type suitable for a `home.file` like option. The
# target path may be either absolute or relative, in which case it # target path may be either absolute or relative, in which case it

View File

@ -5,9 +5,9 @@
{ lib }: { lib }:
with lib;
let let
inherit (lib)
concatMapStringsSep concatStrings escape hasPrefix head replaceStrings;
mkPrimitive = t: v: { mkPrimitive = t: v: {
_type = "gvariant"; _type = "gvariant";

View File

@ -1,8 +1,9 @@
{ lib }: { lib }:
with lib; let
inherit (lib)
{ genList length lowerChars replaceStrings stringToCharacters upperChars;
in {
# Figures out a valid Nix store name for the given path. # Figures out a valid Nix store name for the given path.
storeFileName = path: storeFileName = path:
let let

View File

@ -1,8 +1,10 @@
{ dag, lib }: { dag, lib }:
with lib;
let let
inherit (lib)
concatStringsSep defaultFunctor fixedWidthNumber imap1 isAttrs isList length
listToAttrs mapAttrs mkIf mkOption mkOptionType nameValuePair stringLength
types warn;
isDagEntry = e: isAttrs e && (e ? data) && (e ? after) && (e ? before); isDagEntry = e: isAttrs e && (e ? data) && (e ? after) && (e ? before);

View File

@ -1,9 +1,11 @@
{ lib, dag ? import ./dag.nix { inherit lib; } { lib, dag ? import ./dag.nix { inherit lib; }
, gvariant ? import ./gvariant.nix { inherit lib; } }: , gvariant ? import ./gvariant.nix { inherit lib; } }:
with lib;
let let
inherit (lib)
all concatMap foldl' getFiles getValues head isFunction literalExpression
mergeAttrs mergeDefaultOption mergeOneOption mergeOptions mkOption
mkOptionType showFiles showOption types;
typesDag = import ./types-dag.nix { inherit dag lib; }; typesDag = import ./types-dag.nix { inherit dag lib; };

View File

@ -1,8 +1,7 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
with lib;
let let
inherit (lib) concatStringsSep hm mkMerge mkOption types;
dag = lib.hm.dag; dag = lib.hm.dag;

View File

@ -1,8 +1,7 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
with lib;
let let
inherit (lib) concatStringsSep hm mkOption types;
dag = lib.hm.dag; dag = lib.hm.dag;

View File

@ -1,9 +1,6 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
with lib; let inherit (lib) concatStringsSep hm mapAttrsToList mkMerge mkOption types;
let
in { in {
options.examples = mkOption { type = types.attrsOf hm.types.gvariant; }; options.examples = mkOption { type = types.attrsOf hm.types.gvariant; };

View File

@ -1,8 +1,7 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
with lib;
let let
inherit (lib) concatStringsSep hm mkMerge mkOption types;
dag = lib.hm.dag; dag = lib.hm.dag;