diff options
author | John Ericson <John.Ericson@Obsidian.Systems> | 2018-05-11 11:12:15 -0400 |
---|---|---|
committer | Profpatsch <mail@profpatsch.de> | 2018-05-11 17:43:35 +0200 |
commit | 9e9cdd7027e6d941fc08c2eb71ed5423cf4a8f01 (patch) | |
tree | 0cc7649e890fc4fd59e28b6eb64f901743210ca9 /lib/default.nix | |
parent | 188fdf5bd06de23bd289e2617bb01fb51928fdf9 (diff) |
lib: Add more configure flag helpers
Add with/without to match enable/disable, and add
`--{enable,with}-key=value` versions of both.
Diffstat (limited to 'lib/default.nix')
-rw-r--r-- | lib/default.nix | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/lib/default.nix b/lib/default.nix index 60ce01a93cd2..4ca2e2ea6e37 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -51,11 +51,11 @@ let # back-compat aliases platforms = systems.forMeta; - 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 stringLength sub substring tail; + 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 + stringLength sub substring tail; inherit (trivial) id const concat or and boolToString mergeAttrs flip mapNullable inNixShell min max importJSON warn info nixpkgsVersion version mod compare splitByAndCompare @@ -74,30 +74,32 @@ let inherit (lists) singleton foldr fold foldl foldl' imap0 imap1 concatMap flatten remove findSingle findFirst any all count optional optionals toList range partition zipListsWith zipLists - reverseList listDfs toposort sort naturalSort compareLists take drop sublist - last init crossLists unique intersectLists subtractLists - mutuallyExclusive; + reverseList listDfs toposort sort naturalSort compareLists take + drop sublist last init crossLists unique intersectLists + subtractLists mutuallyExclusive; inherit (strings) concatStrings concatMapStrings concatImapStrings intersperse concatStringsSep concatMapStringsSep concatImapStringsSep makeSearchPath makeSearchPathOutput makeLibraryPath makeBinPath makePerlPath optionalString hasPrefix hasSuffix stringToCharacters stringAsChars escape - escapeShellArg escapeShellArgs replaceChars lowerChars upperChars - toLower toUpper addContextFrom splitString removePrefix - removeSuffix versionOlder versionAtLeast getVersion nameFromURL - enableFeature fixedWidthString fixedWidthNumber isStorePath + escapeShellArg escapeShellArgs replaceChars lowerChars + upperChars toLower toUpper addContextFrom splitString + removePrefix removeSuffix versionOlder versionAtLeast getVersion + nameFromURL enableFeature enableFeatureAs withFeature + withFeatureAs fixedWidthString fixedWidthNumber isStorePath toInt readPathsFromFile fileContents; inherit (stringsWithDeps) textClosureList textClosureMap noDepEntry fullDepEntry packEntry stringAfter; inherit (customisation) overrideDerivation makeOverridable - callPackageWith callPackagesWith extendDerivation - hydraJob makeScope; + callPackageWith callPackagesWith extendDerivation hydraJob + makeScope; inherit (meta) addMetaAttrs dontDistribute setName updateName appendToName mapDerivationAttrset lowPrio lowPrioSet hiPrio hiPrioSet; inherit (sources) pathType pathIsDirectory cleanSourceFilter cleanSource sourceByRegex sourceFilesBySuffices - commitIdFromGitRepo cleanSourceWith pathHasContext canCleanSource; + commitIdFromGitRepo cleanSourceWith pathHasContext + canCleanSource; inherit (modules) evalModules closeModules unifyModuleSyntax applyIfFunction unpackSubmodule packSubmodule mergeModules mergeModules' mergeOptionDecls evalOptionValue mergeDefinitions @@ -119,8 +121,7 @@ let traceXMLVal traceXMLValMarked traceSeq traceSeqN traceValSeq traceValSeqFn traceValSeqN traceValSeqNFn traceShowVal traceShowValMarked showVal traceCall traceCall2 traceCall3 - traceValIfNot runTests testAllTrue traceCallXml - attrNamesToStr; + traceValIfNot runTests testAllTrue traceCallXml attrNamesToStr; inherit (misc) maybeEnv defaultMergeArg defaultMerge foldArgs defaultOverridableDelayableArgs composedArgsAndFun maybeAttrNullable maybeAttr ifEnable checkFlag getValue @@ -129,7 +130,7 @@ let closePropagation mapAttrsFlatten nvs setAttr setAttrMerge mergeAttrsWithFunc mergeAttrsConcatenateValues mergeAttrsNoOverride mergeAttrByFunc mergeAttrsByFuncDefaults - mergeAttrsByFuncDefaultsClean mergeAttrBy - prepareDerivationArgs nixType imap overridableDelayableArgs; + mergeAttrsByFuncDefaultsClean mergeAttrBy prepareDerivationArgs + nixType imap overridableDelayableArgs; }); in lib |