summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvan Mosberger <contact@infinisil.com>2024-06-25 18:33:36 +0200
committerGitHub <noreply@github.com>2024-06-25 18:33:36 +0200
commit8572fec8e05e690cfb8941717f048d037f2b684e (patch)
treeac34ffff8270021520bf8921f59d204ebc2e39ac
parentMerge pull request #321295 from NixOS/backport-321262-to-release-24.05 (diff)
parentlib: Add a TODO for builtins not available in sub-libraries (diff)
downloadnixpkgs-8572fec8e05e690cfb8941717f048d037f2b684e.tar.gz
Merge pull request #321709 from NixOS/backport-321302-to-release-24.05
[Backport release-24.05] `lib`: Inherit exported builtins from the respective sub-library
-rw-r--r--lib/default.nix23
1 files changed, 12 insertions, 11 deletions
diff --git a/lib/default.nix b/lib/default.nix
index 1fb4ce7a6109..9c6f886c9ee4 100644
--- a/lib/default.nix
+++ b/lib/default.nix
@@ -64,22 +64,21 @@ let
# linux kernel configuration
kernel = callLibs ./kernel.nix;
- inherit (builtins) add addErrorContext attrNames concatLists
- deepSeq elem elemAt filter genericClosure genList getAttr
- hasAttr head isAttrs isBool isInt isList isPath isString length
- lessThan listToAttrs pathExists readFile replaceStrings seq
- stringLength sub substring tail trace;
+ # TODO: For consistency, all builtins should also be available from a sub-library;
+ # these are the only ones that are currently not
+ inherit (builtins) addErrorContext isPath trace;
inherit (self.trivial) id const pipe concat or and xor bitAnd bitOr bitXor
bitNot boolToString mergeAttrs flip mapNullable inNixShell isFloat min max
importJSON importTOML warn warnIf warnIfNot throwIf throwIfNot checkListOfEnum
info showWarnings nixpkgsVersion version isInOldestRelease
- mod compare splitByAndCompare
+ mod compare splitByAndCompare seq deepSeq lessThan add sub
functionArgs setFunctionArgs isFunction toFunction mirrorFunctionArgs
- toHexString toBaseDigits inPureEvalMode;
+ toHexString toBaseDigits inPureEvalMode isBool isInt pathExists
+ genericClosure readFile;
inherit (self.fixedPoints) fix fix' converge extends composeExtensions
composeManyExtensions makeExtensible makeExtensibleWithCustomName;
inherit (self.attrsets) attrByPath hasAttrByPath setAttrByPath
- getAttrFromPath attrVals attrValues getAttrs catAttrs filterAttrs
+ getAttrFromPath attrVals attrNames attrValues getAttrs catAttrs filterAttrs
filterAttrsRecursive foldlAttrs foldAttrs collect nameValuePair mapAttrs
mapAttrs' mapAttrsToList attrsToList concatMapAttrs mapAttrsRecursive
mapAttrsRecursiveCond genAttrs isDerivation toDerivation optionalAttrs
@@ -87,14 +86,16 @@ let
recursiveUpdate matchAttrs mergeAttrsList overrideExisting showAttrPath getOutput
getBin getLib getDev getMan chooseDevOutputs zipWithNames zip
recurseIntoAttrs dontRecurseIntoAttrs cartesianProduct cartesianProductOfSets
- mapCartesianProduct updateManyAttrsByPath intersectAttrs removeAttrs;
+ mapCartesianProduct updateManyAttrsByPath listToAttrs hasAttr getAttr isAttrs intersectAttrs removeAttrs;
inherit (self.lists) singleton forEach map foldr fold foldl foldl' imap0 imap1
- ifilter0 concatMap flatten remove findSingle findFirst any all count
+ filter ifilter0 concatMap flatten remove findSingle findFirst any all count
optional optionals toList range replicate partition zipListsWith zipLists
reverseList listDfs toposort sort sortOn naturalSort compareLists take
drop sublist last init crossLists unique allUnique intersectLists
- subtractLists mutuallyExclusive groupBy groupBy';
+ subtractLists mutuallyExclusive groupBy groupBy' concatLists genList
+ length head tail elem elemAt isList;
inherit (self.strings) concatStrings concatMapStrings concatImapStrings
+ stringLength substring isString replaceStrings
intersperse concatStringsSep concatMapStringsSep
concatImapStringsSep concatLines makeSearchPath makeSearchPathOutput
makeLibraryPath makeIncludePath makeBinPath optionalString