| 
									
										
										
										
											2017-03-30 22:03:40 +02:00
										 |  |  | /* Library of low-level helper functions for nix expressions.
 | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * Please implement (mostly) exhaustive unit tests | 
					
						
							|  |  |  |  * for new functions in `./tests.nix'. | 
					
						
							|  |  |  |  */ | 
					
						
							| 
									
										
										
										
											2016-09-15 01:21:42 +02:00
										 |  |  | let | 
					
						
							| 
									
										
										
										
											2006-09-25 10:07:59 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-11-11 10:36:19 +08:00
										 |  |  |   inherit (import ./fixed-points.nix { inherit lib; }) makeExtensible; | 
					
						
							| 
									
										
										
										
											2017-07-28 20:05:35 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-04-06 18:51:10 +02:00
										 |  |  |   lib = makeExtensible (self: let | 
					
						
							|  |  |  |     callLibs = file: import file { lib = self; }; | 
					
						
							| 
									
										
										
										
											2020-10-20 13:47:24 +02:00
										 |  |  |   in { | 
					
						
							| 
									
										
										
										
											2017-07-28 20:05:35 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  |     # often used, or depending on very little | 
					
						
							|  |  |  |     trivial = callLibs ./trivial.nix; | 
					
						
							|  |  |  |     fixedPoints = callLibs ./fixed-points.nix; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     # datatypes | 
					
						
							|  |  |  |     attrsets = callLibs ./attrsets.nix; | 
					
						
							|  |  |  |     lists = callLibs ./lists.nix; | 
					
						
							|  |  |  |     strings = callLibs ./strings.nix; | 
					
						
							|  |  |  |     stringsWithDeps = callLibs ./strings-with-deps.nix; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     # packaging | 
					
						
							|  |  |  |     customisation = callLibs ./customisation.nix; | 
					
						
							| 
									
										
										
										
											2018-03-04 03:09:35 +00:00
										 |  |  |     maintainers = import ../maintainers/maintainer-list.nix; | 
					
						
							| 
									
										
										
										
											2019-10-27 22:44:24 +01:00
										 |  |  |     teams = callLibs ../maintainers/team-list.nix; | 
					
						
							| 
									
										
										
										
											2017-07-28 20:05:35 -04:00
										 |  |  |     meta = callLibs ./meta.nix; | 
					
						
							|  |  |  |     sources = callLibs ./sources.nix; | 
					
						
							| 
									
										
										
										
											2018-03-02 20:26:32 -08:00
										 |  |  |     versions = callLibs ./versions.nix; | 
					
						
							| 
									
										
										
										
											2017-07-28 20:05:35 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  |     # module system | 
					
						
							|  |  |  |     modules = callLibs ./modules.nix; | 
					
						
							|  |  |  |     options = callLibs ./options.nix; | 
					
						
							|  |  |  |     types = callLibs ./types.nix; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     # constants | 
					
						
							|  |  |  |     licenses = callLibs ./licenses.nix; | 
					
						
							|  |  |  |     systems = callLibs ./systems; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-01-22 23:22:23 +01:00
										 |  |  |     # serialization | 
					
						
							|  |  |  |     cli = callLibs ./cli.nix; | 
					
						
							|  |  |  |     generators = callLibs ./generators.nix; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-07-28 20:05:35 -04:00
										 |  |  |     # misc | 
					
						
							| 
									
										
										
										
											2018-08-08 19:26:52 +02:00
										 |  |  |     asserts = callLibs ./asserts.nix; | 
					
						
							| 
									
										
										
										
											2017-07-28 20:05:35 -04:00
										 |  |  |     debug = callLibs ./debug.nix; | 
					
						
							|  |  |  |     misc = callLibs ./deprecated.nix; | 
					
						
							| 
									
										
										
										
											2018-08-08 19:26:52 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-07-28 20:05:35 -04:00
										 |  |  |     # domain-specific | 
					
						
							|  |  |  |     fetchers = callLibs ./fetchers.nix; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     # Eval-time filesystem handling | 
					
						
							|  |  |  |     filesystem = callLibs ./filesystem.nix; | 
					
						
							| 
									
										
										
										
											2017-02-08 21:27:22 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  |     # back-compat aliases | 
					
						
							| 
									
										
										
										
											2020-10-20 13:47:24 +02:00
										 |  |  |     platforms = self.systems.doubles; | 
					
						
							| 
									
										
										
										
											2017-07-28 20:05:35 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-09-18 17:34:02 +09:00
										 |  |  |     # linux kernel configuration | 
					
						
							|  |  |  |     kernel = callLibs ./kernel.nix; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-05-11 11:12:15 -04:00
										 |  |  |     inherit (builtins) add addErrorContext attrNames concatLists | 
					
						
							|  |  |  |       deepSeq elem elemAt filter genericClosure genList getAttr | 
					
						
							|  |  |  |       hasAttr head isAttrs isBool isInt isList isString length | 
					
						
							|  |  |  |       lessThan listToAttrs pathExists readFile replaceStrings seq | 
					
						
							| 
									
										
										
										
											2020-10-20 16:34:15 +02:00
										 |  |  |       stringLength sub substring tail trace; | 
					
						
							| 
									
										
										
										
											2020-10-20 13:47:24 +02:00
										 |  |  |     inherit (self.trivial) id const pipe concat or and bitAnd bitOr bitXor | 
					
						
							| 
									
										
										
										
											2020-10-20 15:24:59 +02:00
										 |  |  |       bitNot boolToString mergeAttrs flip mapNullable inNixShell isFloat min max | 
					
						
							| 
									
										
										
										
											2020-08-16 15:39:52 +02:00
										 |  |  |       importJSON importTOML warn info showWarnings nixpkgsVersion version mod compare | 
					
						
							| 
									
										
										
										
											2020-07-20 13:14:19 +02:00
										 |  |  |       splitByAndCompare functionArgs setFunctionArgs isFunction toHexString toBaseDigits; | 
					
						
							| 
									
										
										
										
											2020-10-20 13:47:24 +02:00
										 |  |  |     inherit (self.fixedPoints) fix fix' converge extends composeExtensions | 
					
						
							| 
									
										
										
										
											2020-11-11 10:36:19 +08:00
										 |  |  |       composeManyExtensions makeExtensible makeExtensibleWithCustomName; | 
					
						
							| 
									
										
										
										
											2020-10-20 13:47:24 +02:00
										 |  |  |     inherit (self.attrsets) attrByPath hasAttrByPath setAttrByPath | 
					
						
							| 
									
										
										
										
											2018-12-11 21:18:22 +00:00
										 |  |  |       getAttrFromPath attrVals attrValues getAttrs catAttrs filterAttrs | 
					
						
							| 
									
										
										
										
											2017-07-28 20:05:35 -04:00
										 |  |  |       filterAttrsRecursive foldAttrs collect nameValuePair mapAttrs | 
					
						
							|  |  |  |       mapAttrs' mapAttrsToList mapAttrsRecursive mapAttrsRecursiveCond | 
					
						
							|  |  |  |       genAttrs isDerivation toDerivation optionalAttrs | 
					
						
							|  |  |  |       zipAttrsWithNames zipAttrsWith zipAttrs recursiveUpdateUntil | 
					
						
							|  |  |  |       recursiveUpdate matchAttrs overrideExisting getOutput getBin | 
					
						
							| 
									
										
										
										
											2020-05-11 11:08:29 +02:00
										 |  |  |       getLib getDev getMan chooseDevOutputs zipWithNames zip | 
					
						
							| 
									
										
										
										
											2021-01-25 16:59:46 +01:00
										 |  |  |       recurseIntoAttrs dontRecurseIntoAttrs cartesianProductOfSets; | 
					
						
							| 
									
										
										
										
											2020-10-20 13:47:24 +02:00
										 |  |  |     inherit (self.lists) singleton forEach foldr fold foldl foldl' imap0 imap1 | 
					
						
							| 
									
										
										
										
											2017-07-28 20:05:35 -04:00
										 |  |  |       concatMap flatten remove findSingle findFirst any all count | 
					
						
							|  |  |  |       optional optionals toList range partition zipListsWith zipLists | 
					
						
							| 
									
										
										
										
											2018-05-11 11:12:15 -04:00
										 |  |  |       reverseList listDfs toposort sort naturalSort compareLists take | 
					
						
							|  |  |  |       drop sublist last init crossLists unique intersectLists | 
					
						
							| 
									
										
										
										
											2018-06-10 17:31:09 +00:00
										 |  |  |       subtractLists mutuallyExclusive groupBy groupBy'; | 
					
						
							| 
									
										
										
										
											2020-10-20 13:47:24 +02:00
										 |  |  |     inherit (self.strings) concatStrings concatMapStrings concatImapStrings | 
					
						
							| 
									
										
										
										
											2017-07-28 20:05:35 -04:00
										 |  |  |       intersperse concatStringsSep concatMapStringsSep | 
					
						
							|  |  |  |       concatImapStringsSep makeSearchPath makeSearchPathOutput | 
					
						
							| 
									
										
										
										
											2018-12-15 03:50:31 +00:00
										 |  |  |       makeLibraryPath makeBinPath optionalString | 
					
						
							| 
									
										
										
										
											2019-02-04 00:09:38 -08:00
										 |  |  |       hasInfix hasPrefix hasSuffix stringToCharacters stringAsChars escape | 
					
						
							| 
									
										
										
										
											2018-05-11 11:12:15 -04:00
										 |  |  |       escapeShellArg escapeShellArgs replaceChars lowerChars | 
					
						
							|  |  |  |       upperChars toLower toUpper addContextFrom splitString | 
					
						
							| 
									
										
										
										
											2019-11-24 16:19:32 +00:00
										 |  |  |       removePrefix removeSuffix versionOlder versionAtLeast | 
					
						
							|  |  |  |       getName getVersion | 
					
						
							| 
									
										
										
										
											2018-05-11 11:12:15 -04:00
										 |  |  |       nameFromURL enableFeature enableFeatureAs withFeature | 
					
						
							|  |  |  |       withFeatureAs fixedWidthString fixedWidthNumber isStorePath | 
					
						
							| 
									
										
										
										
											2017-07-28 20:05:35 -04:00
										 |  |  |       toInt readPathsFromFile fileContents; | 
					
						
							| 
									
										
										
										
											2020-10-20 13:47:24 +02:00
										 |  |  |     inherit (self.stringsWithDeps) textClosureList textClosureMap | 
					
						
							| 
									
										
										
										
											2017-07-28 20:05:35 -04:00
										 |  |  |       noDepEntry fullDepEntry packEntry stringAfter; | 
					
						
							| 
									
										
										
										
											2020-10-20 13:47:24 +02:00
										 |  |  |     inherit (self.customisation) overrideDerivation makeOverridable | 
					
						
							| 
									
										
										
										
											2018-05-11 11:12:15 -04:00
										 |  |  |       callPackageWith callPackagesWith extendDerivation hydraJob | 
					
						
							| 
									
										
										
										
											2020-11-18 12:12:34 -05:00
										 |  |  |       makeScope makeScopeWithSplicing; | 
					
						
							| 
									
										
										
										
											2020-10-20 13:47:24 +02:00
										 |  |  |     inherit (self.meta) addMetaAttrs dontDistribute setName updateName | 
					
						
							| 
									
										
										
										
											2018-11-18 08:26:13 +00:00
										 |  |  |       appendToName mapDerivationAttrset setPrio lowPrio lowPrioSet hiPrio | 
					
						
							| 
									
										
										
										
											2017-07-28 20:05:35 -04:00
										 |  |  |       hiPrioSet; | 
					
						
							| 
									
										
										
										
											2020-10-20 13:47:24 +02:00
										 |  |  |     inherit (self.sources) pathType pathIsDirectory cleanSourceFilter | 
					
						
							| 
									
										
										
										
											2017-07-28 20:05:35 -04:00
										 |  |  |       cleanSource sourceByRegex sourceFilesBySuffices | 
					
						
							| 
									
										
										
										
											2018-05-11 11:12:15 -04:00
										 |  |  |       commitIdFromGitRepo cleanSourceWith pathHasContext | 
					
						
							| 
									
										
										
										
											2020-01-20 00:44:07 +01:00
										 |  |  |       canCleanSource pathIsRegularFile pathIsGitRepo; | 
					
						
							| 
									
										
										
										
											2020-10-20 13:47:24 +02:00
										 |  |  |     inherit (self.modules) evalModules unifyModuleSyntax | 
					
						
							| 
									
										
										
										
											2019-12-05 03:29:51 +01:00
										 |  |  |       applyIfFunction mergeModules | 
					
						
							| 
									
										
										
										
											2017-07-28 20:05:35 -04:00
										 |  |  |       mergeModules' mergeOptionDecls evalOptionValue mergeDefinitions | 
					
						
							|  |  |  |       pushDownProperties dischargeProperties filterOverrides | 
					
						
							|  |  |  |       sortProperties fixupOptionType mkIf mkAssert mkMerge mkOverride | 
					
						
							|  |  |  |       mkOptionDefault mkDefault mkForce mkVMOverride mkStrict | 
					
						
							|  |  |  |       mkFixStrictness mkOrder mkBefore mkAfter mkAliasDefinitions | 
					
						
							|  |  |  |       mkAliasAndWrapDefinitions fixMergeModules mkRemovedOptionModule | 
					
						
							|  |  |  |       mkRenamedOptionModule mkMergedOptionModule mkChangedOptionModule | 
					
						
							| 
									
										
										
										
											2020-01-02 22:09:31 +01:00
										 |  |  |       mkAliasOptionModule doRename; | 
					
						
							| 
									
										
										
										
											2020-10-20 13:47:24 +02:00
										 |  |  |     inherit (self.options) isOption mkEnableOption mkSinkUndeclaredOptions | 
					
						
							| 
									
										
										
										
											2017-07-28 20:05:35 -04:00
										 |  |  |       mergeDefaultOption mergeOneOption mergeEqualOption getValues | 
					
						
							|  |  |  |       getFiles optionAttrSetToDocList optionAttrSetToDocList' | 
					
						
							|  |  |  |       scrubOptionValue literalExample showOption showFiles | 
					
						
							|  |  |  |       unknownModule mkOption; | 
					
						
							| 
									
										
										
										
											2020-10-20 13:47:24 +02:00
										 |  |  |     inherit (self.types) isType setType defaultTypeMerge defaultFunctor | 
					
						
							| 
									
										
										
										
											2017-07-28 20:05:35 -04:00
										 |  |  |       isOptionType mkOptionType; | 
					
						
							| 
									
										
										
										
											2020-10-20 13:47:24 +02:00
										 |  |  |     inherit (self.asserts) | 
					
						
							| 
									
										
										
										
											2018-08-08 19:26:52 +02:00
										 |  |  |       assertMsg assertOneOf; | 
					
						
							| 
									
										
										
										
											2020-10-20 13:47:24 +02:00
										 |  |  |     inherit (self.debug) addErrorContextToAttrs traceIf traceVal traceValFn | 
					
						
							| 
									
										
										
										
											2017-07-28 20:05:35 -04:00
										 |  |  |       traceXMLVal traceXMLValMarked traceSeq traceSeqN traceValSeq | 
					
						
							| 
									
										
										
										
											2021-01-24 11:33:41 +01:00
										 |  |  |       traceValSeqFn traceValSeqN traceValSeqNFn traceFnSeqN traceShowVal | 
					
						
							| 
									
										
										
										
											2018-04-02 17:21:35 +02:00
										 |  |  |       traceShowValMarked showVal traceCall traceCall2 traceCall3 | 
					
						
							| 
									
										
										
										
											2018-05-11 11:12:15 -04:00
										 |  |  |       traceValIfNot runTests testAllTrue traceCallXml attrNamesToStr; | 
					
						
							| 
									
										
										
										
											2020-10-20 13:47:24 +02:00
										 |  |  |     inherit (self.misc) maybeEnv defaultMergeArg defaultMerge foldArgs | 
					
						
							| 
									
										
										
										
											2017-07-28 20:05:35 -04:00
										 |  |  |       maybeAttrNullable maybeAttr ifEnable checkFlag getValue | 
					
						
							|  |  |  |       checkReqs uniqList uniqListExt condConcat lazyGenericClosure | 
					
						
							|  |  |  |       innerModifySumArgs modifySumArgs innerClosePropagation | 
					
						
							|  |  |  |       closePropagation mapAttrsFlatten nvs setAttr setAttrMerge | 
					
						
							|  |  |  |       mergeAttrsWithFunc mergeAttrsConcatenateValues | 
					
						
							|  |  |  |       mergeAttrsNoOverride mergeAttrByFunc mergeAttrsByFuncDefaults | 
					
						
							| 
									
										
										
										
											2018-07-26 12:05:40 +02:00
										 |  |  |       mergeAttrsByFuncDefaultsClean mergeAttrBy | 
					
						
							| 
									
										
										
										
											2020-05-11 23:04:41 +01:00
										 |  |  |       fakeHash fakeSha256 fakeSha512 | 
					
						
							| 
									
										
										
										
											2018-07-26 12:05:40 +02:00
										 |  |  |       nixType imap; | 
					
						
							| 
									
										
										
										
											2020-10-20 13:47:24 +02:00
										 |  |  |     inherit (self.versions) | 
					
						
							| 
									
										
										
										
											2019-09-24 10:47:34 +02:00
										 |  |  |       splitVersion; | 
					
						
							| 
									
										
										
										
											2018-04-06 18:51:10 +02:00
										 |  |  |   }); | 
					
						
							| 
									
										
										
										
											2017-07-28 20:05:35 -04:00
										 |  |  | in lib |