diff options
author | Alyssa Ross <hi@alyssa.is> | 2023-06-16 06:56:35 +0000 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2023-06-16 06:56:35 +0000 |
commit | 99fcaeccb89621dd492203ce1f2d551c06f228ed (patch) | |
tree | 41cb730ae07383004789779b0f6e11cb3f4642a3 /nixpkgs/lib/default.nix | |
parent | 59c5f5ac8682acc13bb22bc29c7cf02f7d75f01f (diff) | |
parent | 75a5ebf473cd60148ba9aec0d219f72e5cf52519 (diff) | |
download | nixlib-99fcaeccb89621dd492203ce1f2d551c06f228ed.tar nixlib-99fcaeccb89621dd492203ce1f2d551c06f228ed.tar.gz nixlib-99fcaeccb89621dd492203ce1f2d551c06f228ed.tar.bz2 nixlib-99fcaeccb89621dd492203ce1f2d551c06f228ed.tar.lz nixlib-99fcaeccb89621dd492203ce1f2d551c06f228ed.tar.xz nixlib-99fcaeccb89621dd492203ce1f2d551c06f228ed.tar.zst nixlib-99fcaeccb89621dd492203ce1f2d551c06f228ed.zip |
Merge branch 'nixos-unstable' of https://github.com/NixOS/nixpkgs
Conflicts: nixpkgs/nixos/modules/config/console.nix nixpkgs/nixos/modules/services/mail/mailman.nix nixpkgs/nixos/modules/services/mail/public-inbox.nix nixpkgs/nixos/modules/services/mail/rss2email.nix nixpkgs/nixos/modules/services/networking/ssh/sshd.nix nixpkgs/pkgs/applications/networking/instant-messengers/dino/default.nix nixpkgs/pkgs/applications/networking/irc/weechat/default.nix nixpkgs/pkgs/applications/window-managers/sway/default.nix nixpkgs/pkgs/build-support/go/module.nix nixpkgs/pkgs/build-support/rust/build-rust-package/default.nix nixpkgs/pkgs/development/interpreters/python/default.nix nixpkgs/pkgs/development/node-packages/overrides.nix nixpkgs/pkgs/development/tools/b4/default.nix nixpkgs/pkgs/servers/dict/dictd-db.nix nixpkgs/pkgs/servers/mail/public-inbox/default.nix nixpkgs/pkgs/tools/security/pinentry/default.nix nixpkgs/pkgs/tools/text/unoconv/default.nix nixpkgs/pkgs/top-level/all-packages.nix
Diffstat (limited to 'nixpkgs/lib/default.nix')
-rw-r--r-- | nixpkgs/lib/default.nix | 47 |
1 files changed, 27 insertions, 20 deletions
diff --git a/nixpkgs/lib/default.nix b/nixpkgs/lib/default.nix index e2a93e63ac1f..8fea4b8ad637 100644 --- a/nixpkgs/lib/default.nix +++ b/nixpkgs/lib/default.nix @@ -1,7 +1,7 @@ /* Library of low-level helper functions for nix expressions. * * Please implement (mostly) exhaustive unit tests - * for new functions in `./tests.nix'. + * for new functions in `./tests.nix`. */ let @@ -23,10 +23,10 @@ let # packaging customisation = callLibs ./customisation.nix; + derivations = callLibs ./derivations.nix; maintainers = import ../maintainers/maintainer-list.nix; teams = callLibs ../maintainers/team-list.nix; meta = callLibs ./meta.nix; - sources = callLibs ./sources.nix; versions = callLibs ./versions.nix; # module system @@ -52,7 +52,9 @@ let fetchers = callLibs ./fetchers.nix; # Eval-time filesystem handling + path = callLibs ./path; filesystem = callLibs ./filesystem.nix; + sources = callLibs ./sources.nix; # back-compat aliases platforms = self.systems.doubles; @@ -62,7 +64,7 @@ let inherit (builtins) add addErrorContext attrNames concatLists deepSeq elem elemAt filter genericClosure genList getAttr - hasAttr head isAttrs isBool isInt isList isString length + hasAttr head isAttrs isBool isInt isList isPath isString length lessThan listToAttrs pathExists readFile replaceStrings seq stringLength sub substring tail trace; inherit (self.trivial) id const pipe concat or and bitAnd bitOr bitXor @@ -76,8 +78,8 @@ let composeManyExtensions makeExtensible makeExtensibleWithCustomName; inherit (self.attrsets) attrByPath hasAttrByPath setAttrByPath getAttrFromPath attrVals attrValues getAttrs catAttrs filterAttrs - filterAttrsRecursive foldAttrs collect nameValuePair mapAttrs - mapAttrs' mapAttrsToList mapAttrsRecursive mapAttrsRecursiveCond + filterAttrsRecursive foldlAttrs foldAttrs collect nameValuePair mapAttrs + mapAttrs' mapAttrsToList concatMapAttrs mapAttrsRecursive mapAttrsRecursiveCond genAttrs isDerivation toDerivation optionalAttrs zipAttrsWithNames zipAttrsWith zipAttrs recursiveUpdateUntil recursiveUpdate matchAttrs overrideExisting showAttrPath getOutput getBin @@ -86,35 +88,40 @@ let updateManyAttrsByPath; inherit (self.lists) singleton forEach foldr fold foldl foldl' imap0 imap1 concatMap flatten remove findSingle findFirst any all count - optional optionals toList range partition zipListsWith zipLists + optional optionals toList range replicate partition zipListsWith zipLists reverseList listDfs toposort sort naturalSort compareLists take drop sublist last init crossLists unique intersectLists subtractLists mutuallyExclusive groupBy groupBy'; inherit (self.strings) concatStrings concatMapStrings concatImapStrings intersperse concatStringsSep concatMapStringsSep - concatImapStringsSep makeSearchPath makeSearchPathOutput + concatImapStringsSep concatLines makeSearchPath makeSearchPathOutput makeLibraryPath makeBinPath optionalString hasInfix hasPrefix hasSuffix stringToCharacters stringAsChars escape - escapeShellArg escapeShellArgs isValidPosixName toShellVar toShellVars - escapeRegex escapeXML replaceChars lowerChars + escapeShellArg escapeShellArgs + isStorePath isStringLike + isValidPosixName toShellVar toShellVars + escapeRegex escapeURL escapeXML replaceChars lowerChars upperChars toLower toUpper addContextFrom splitString removePrefix removeSuffix versionOlder versionAtLeast getName getVersion + mesonOption mesonBool mesonEnable nameFromURL enableFeature enableFeatureAs withFeature - withFeatureAs fixedWidthString fixedWidthNumber isStorePath - toInt readPathsFromFile fileContents; + withFeatureAs fixedWidthString fixedWidthNumber + toInt toIntBase10 readPathsFromFile fileContents; inherit (self.stringsWithDeps) textClosureList textClosureMap noDepEntry fullDepEntry packEntry stringAfter; inherit (self.customisation) overrideDerivation makeOverridable callPackageWith callPackagesWith extendDerivation hydraJob makeScope makeScopeWithSplicing; + inherit (self.derivations) lazyDerivation; inherit (self.meta) addMetaAttrs dontDistribute setName updateName appendToName mapDerivationAttrset setPrio lowPrio lowPrioSet hiPrio hiPrioSet getLicenseFromSpdxId getExe; - inherit (self.sources) pathType pathIsDirectory cleanSourceFilter + inherit (self.filesystem) pathType pathIsDirectory pathIsRegularFile; + inherit (self.sources) cleanSourceFilter cleanSource sourceByRegex sourceFilesBySuffices commitIdFromGitRepo cleanSourceWith pathHasContext - canCleanSource pathIsRegularFile pathIsGitRepo; + canCleanSource pathIsGitRepo; inherit (self.modules) evalModules setDefaultModuleLocation unifyModuleSyntax applyModuleArgsIfFunction mergeModules mergeModules' mergeOptionDecls evalOptionValue mergeDefinitions @@ -125,24 +132,24 @@ let mkAliasAndWrapDefinitions fixMergeModules mkRemovedOptionModule mkRenamedOptionModule mkRenamedOptionModuleWith mkMergedOptionModule mkChangedOptionModule - mkAliasOptionModule mkDerivedConfig doRename; + mkAliasOptionModule mkDerivedConfig doRename + mkAliasOptionModuleMD; inherit (self.options) isOption mkEnableOption mkSinkUndeclaredOptions mergeDefaultOption mergeOneOption mergeEqualOption mergeUniqueOption getValues getFiles optionAttrSetToDocList optionAttrSetToDocList' scrubOptionValue literalExpression literalExample literalDocBook showOption showOptionWithDefLocs showFiles - unknownModule mkOption mkPackageOption + unknownModule mkOption mkPackageOption mkPackageOptionMD mdDoc literalMD; inherit (self.types) isType setType defaultTypeMerge defaultFunctor isOptionType mkOptionType; inherit (self.asserts) assertMsg assertOneOf; - inherit (self.debug) addErrorContextToAttrs traceIf traceVal traceValFn - traceXMLVal traceXMLValMarked traceSeq traceSeqN traceValSeq - traceValSeqFn traceValSeqN traceValSeqNFn traceFnSeqN traceShowVal - traceShowValMarked showVal traceCall traceCall2 traceCall3 - traceValIfNot runTests testAllTrue traceCallXml attrNamesToStr; + inherit (self.debug) traceIf traceVal traceValFn + traceSeq traceSeqN traceValSeq + traceValSeqFn traceValSeqN traceValSeqNFn traceFnSeqN + runTests testAllTrue; inherit (self.misc) maybeEnv defaultMergeArg defaultMerge foldArgs maybeAttrNullable maybeAttr ifEnable checkFlag getValue checkReqs uniqList uniqListExt condConcat lazyGenericClosure |