From 69f84db44297bfdbc87e31606046e0953e9338ea Mon Sep 17 00:00:00 2001 From: Silvan Mosberger Date: Thu, 20 Jun 2024 18:25:37 +0200 Subject: [PATCH 01/29] lib: inherit concatLists via lib.lists --- lib/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/default.nix b/lib/default.nix index 1fb4ce7a6109..998f7c1c48b5 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -64,7 +64,7 @@ let # linux kernel configuration kernel = callLibs ./kernel.nix; - inherit (builtins) add addErrorContext attrNames concatLists + inherit (builtins) add addErrorContext attrNames deepSeq elem elemAt filter genericClosure genList getAttr hasAttr head isAttrs isBool isInt isList isPath isString length lessThan listToAttrs pathExists readFile replaceStrings seq @@ -93,7 +93,7 @@ let 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; inherit (self.strings) concatStrings concatMapStrings concatImapStrings intersperse concatStringsSep concatMapStringsSep concatImapStringsSep concatLines makeSearchPath makeSearchPathOutput From c60c3baf238a2a1fb4709e0080560bea574ae36f Mon Sep 17 00:00:00 2001 From: Silvan Mosberger Date: Thu, 20 Jun 2024 18:26:14 +0200 Subject: [PATCH 02/29] lib.attrNames: inherit from lib.attrsets --- lib/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/default.nix b/lib/default.nix index 998f7c1c48b5..1fa7bd236b11 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -64,7 +64,7 @@ let # linux kernel configuration kernel = callLibs ./kernel.nix; - inherit (builtins) add addErrorContext attrNames + inherit (builtins) add addErrorContext deepSeq elem elemAt filter genericClosure genList getAttr hasAttr head isAttrs isBool isInt isList isPath isString length lessThan listToAttrs pathExists readFile replaceStrings seq @@ -79,7 +79,7 @@ let 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 From 30def45e47540ec1b034fc1dbdcf6619f96ca6a0 Mon Sep 17 00:00:00 2001 From: Silvan Mosberger Date: Thu, 20 Jun 2024 18:26:49 +0200 Subject: [PATCH 03/29] lib.filter: inherit from lib.lists --- lib/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/default.nix b/lib/default.nix index 1fa7bd236b11..abe205e68d82 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -65,7 +65,7 @@ let kernel = callLibs ./kernel.nix; inherit (builtins) add addErrorContext - deepSeq elem elemAt filter genericClosure genList getAttr + deepSeq elem elemAt genericClosure genList getAttr hasAttr head isAttrs isBool isInt isList isPath isString length lessThan listToAttrs pathExists readFile replaceStrings seq stringLength sub substring tail trace; @@ -89,7 +89,7 @@ let recurseIntoAttrs dontRecurseIntoAttrs cartesianProduct cartesianProductOfSets mapCartesianProduct updateManyAttrsByPath 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 From d81f4e5eba64c002a30e73d27b5656b1b98be2ec Mon Sep 17 00:00:00 2001 From: Silvan Mosberger Date: Thu, 20 Jun 2024 18:27:34 +0200 Subject: [PATCH 04/29] lib.genList: inherit from lib.lists --- lib/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/default.nix b/lib/default.nix index abe205e68d82..460d62eac432 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -65,7 +65,7 @@ let kernel = callLibs ./kernel.nix; inherit (builtins) add addErrorContext - deepSeq elem elemAt genericClosure genList getAttr + deepSeq elem elemAt genericClosure getAttr hasAttr head isAttrs isBool isInt isList isPath isString length lessThan listToAttrs pathExists readFile replaceStrings seq stringLength sub substring tail trace; @@ -93,7 +93,7 @@ let 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' concatLists; + subtractLists mutuallyExclusive groupBy groupBy' concatLists genList; inherit (self.strings) concatStrings concatMapStrings concatImapStrings intersperse concatStringsSep concatMapStringsSep concatImapStringsSep concatLines makeSearchPath makeSearchPathOutput From 357e95419889dc2ea2397814e179ba72b947c1e9 Mon Sep 17 00:00:00 2001 From: Silvan Mosberger Date: Thu, 20 Jun 2024 18:28:08 +0200 Subject: [PATCH 05/29] lib.length: inherit from lib.lists --- lib/default.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/default.nix b/lib/default.nix index 460d62eac432..fdc6b2afce9d 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -66,7 +66,7 @@ let inherit (builtins) add addErrorContext deepSeq elem elemAt genericClosure getAttr - hasAttr head isAttrs isBool isInt isList isPath isString length + hasAttr head isAttrs isBool isInt isList isPath isString lessThan listToAttrs pathExists readFile replaceStrings seq stringLength sub substring tail trace; inherit (self.trivial) id const pipe concat or and xor bitAnd bitOr bitXor @@ -93,7 +93,8 @@ let 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' concatLists genList; + subtractLists mutuallyExclusive groupBy groupBy' concatLists genList + length; inherit (self.strings) concatStrings concatMapStrings concatImapStrings intersperse concatStringsSep concatMapStringsSep concatImapStringsSep concatLines makeSearchPath makeSearchPathOutput From 6e98b0c0c64d856d872d5f883f7121d9006afe89 Mon Sep 17 00:00:00 2001 From: Silvan Mosberger Date: Thu, 20 Jun 2024 18:29:27 +0200 Subject: [PATCH 06/29] lib.stringLength: inherit from lib.strings --- lib/default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/default.nix b/lib/default.nix index fdc6b2afce9d..81c764c66f5b 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -68,7 +68,7 @@ let deepSeq elem elemAt genericClosure getAttr hasAttr head isAttrs isBool isInt isList isPath isString lessThan listToAttrs pathExists readFile replaceStrings seq - stringLength sub substring tail trace; + sub substring tail 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 @@ -96,6 +96,7 @@ let subtractLists mutuallyExclusive groupBy groupBy' concatLists genList length; inherit (self.strings) concatStrings concatMapStrings concatImapStrings + stringLength intersperse concatStringsSep concatMapStringsSep concatImapStringsSep concatLines makeSearchPath makeSearchPathOutput makeLibraryPath makeIncludePath makeBinPath optionalString From 0a162f4dcdab8f283d471f305735eca9a5a77003 Mon Sep 17 00:00:00 2001 From: Silvan Mosberger Date: Thu, 20 Jun 2024 18:30:20 +0200 Subject: [PATCH 07/29] lib.tail: inherit from lib.lists --- lib/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/default.nix b/lib/default.nix index 81c764c66f5b..0da4361f0157 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -68,7 +68,7 @@ let deepSeq elem elemAt genericClosure getAttr hasAttr head isAttrs isBool isInt isList isPath isString lessThan listToAttrs pathExists readFile replaceStrings seq - sub substring tail trace; + sub substring 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 @@ -94,7 +94,7 @@ let reverseList listDfs toposort sort sortOn naturalSort compareLists take drop sublist last init crossLists unique allUnique intersectLists subtractLists mutuallyExclusive groupBy groupBy' concatLists genList - length; + length tail; inherit (self.strings) concatStrings concatMapStrings concatImapStrings stringLength intersperse concatStringsSep concatMapStringsSep From f6cbaeca60d641d71377050cef27f6cdf74f8b72 Mon Sep 17 00:00:00 2001 From: Silvan Mosberger Date: Thu, 20 Jun 2024 18:30:39 +0200 Subject: [PATCH 08/29] lib.head: inherit from lib.lists --- lib/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/default.nix b/lib/default.nix index 0da4361f0157..51994b24e90d 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -66,7 +66,7 @@ let inherit (builtins) add addErrorContext deepSeq elem elemAt genericClosure getAttr - hasAttr head isAttrs isBool isInt isList isPath isString + hasAttr isAttrs isBool isInt isList isPath isString lessThan listToAttrs pathExists readFile replaceStrings seq sub substring trace; inherit (self.trivial) id const pipe concat or and xor bitAnd bitOr bitXor @@ -94,7 +94,7 @@ let reverseList listDfs toposort sort sortOn naturalSort compareLists take drop sublist last init crossLists unique allUnique intersectLists subtractLists mutuallyExclusive groupBy groupBy' concatLists genList - length tail; + length head tail; inherit (self.strings) concatStrings concatMapStrings concatImapStrings stringLength intersperse concatStringsSep concatMapStringsSep From 00972297be0f3b9cb0ec6f483a4c6fd2505b4b3f Mon Sep 17 00:00:00 2001 From: Silvan Mosberger Date: Thu, 20 Jun 2024 18:31:28 +0200 Subject: [PATCH 09/29] lib.substring: inherit from lib.strings --- lib/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/default.nix b/lib/default.nix index 51994b24e90d..911e4f5f71d0 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -68,7 +68,7 @@ let deepSeq elem elemAt genericClosure getAttr hasAttr isAttrs isBool isInt isList isPath isString lessThan listToAttrs pathExists readFile replaceStrings seq - sub substring trace; + sub 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 @@ -96,7 +96,7 @@ let subtractLists mutuallyExclusive groupBy groupBy' concatLists genList length head tail; inherit (self.strings) concatStrings concatMapStrings concatImapStrings - stringLength + stringLength substring intersperse concatStringsSep concatMapStringsSep concatImapStringsSep concatLines makeSearchPath makeSearchPathOutput makeLibraryPath makeIncludePath makeBinPath optionalString From 597f62d78254c6cb4bf4f4e15a4aa8f001047d89 Mon Sep 17 00:00:00 2001 From: Silvan Mosberger Date: Thu, 20 Jun 2024 18:32:38 +0200 Subject: [PATCH 10/29] lib.listToAttrs: inherit from lib.attrsets --- lib/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/default.nix b/lib/default.nix index 911e4f5f71d0..8c014cd0d9e5 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -67,7 +67,7 @@ let inherit (builtins) add addErrorContext deepSeq elem elemAt genericClosure getAttr hasAttr isAttrs isBool isInt isList isPath isString - lessThan listToAttrs pathExists readFile replaceStrings seq + lessThan pathExists readFile replaceStrings seq sub trace; inherit (self.trivial) id const pipe concat or and xor bitAnd bitOr bitXor bitNot boolToString mergeAttrs flip mapNullable inNixShell isFloat min max @@ -87,7 +87,7 @@ 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 intersectAttrs removeAttrs; inherit (self.lists) singleton forEach map foldr fold foldl foldl' imap0 imap1 filter ifilter0 concatMap flatten remove findSingle findFirst any all count optional optionals toList range replicate partition zipListsWith zipLists From 64e8494f8adf10de5604c0a555e196b2043632af Mon Sep 17 00:00:00 2001 From: Silvan Mosberger Date: Thu, 20 Jun 2024 18:35:34 +0200 Subject: [PATCH 11/29] lib.seq: inherit from lib.trivial --- lib/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/default.nix b/lib/default.nix index 8c014cd0d9e5..0314cc19fce8 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -67,13 +67,13 @@ let inherit (builtins) add addErrorContext deepSeq elem elemAt genericClosure getAttr hasAttr isAttrs isBool isInt isList isPath isString - lessThan pathExists readFile replaceStrings seq + lessThan pathExists readFile replaceStrings sub 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 functionArgs setFunctionArgs isFunction toFunction mirrorFunctionArgs toHexString toBaseDigits inPureEvalMode; inherit (self.fixedPoints) fix fix' converge extends composeExtensions From 74c87fd8888d220c65ddfdcdfbc9b88daa571b68 Mon Sep 17 00:00:00 2001 From: Silvan Mosberger Date: Thu, 20 Jun 2024 18:36:42 +0200 Subject: [PATCH 12/29] lib.lessThan: inherit from lib.trivial --- lib/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/default.nix b/lib/default.nix index 0314cc19fce8..f7a42f8a0c29 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -67,13 +67,13 @@ let inherit (builtins) add addErrorContext deepSeq elem elemAt genericClosure getAttr hasAttr isAttrs isBool isInt isList isPath isString - lessThan pathExists readFile replaceStrings + pathExists readFile replaceStrings sub 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 seq + mod compare splitByAndCompare seq lessThan functionArgs setFunctionArgs isFunction toFunction mirrorFunctionArgs toHexString toBaseDigits inPureEvalMode; inherit (self.fixedPoints) fix fix' converge extends composeExtensions From a32d38d38063b8f50895a26f25d713a84fa58004 Mon Sep 17 00:00:00 2001 From: Silvan Mosberger Date: Thu, 20 Jun 2024 18:37:10 +0200 Subject: [PATCH 13/29] lib.add: inherit from lib.trivial --- lib/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/default.nix b/lib/default.nix index f7a42f8a0c29..c172f24c36e6 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -64,7 +64,7 @@ let # linux kernel configuration kernel = callLibs ./kernel.nix; - inherit (builtins) add addErrorContext + inherit (builtins) addErrorContext deepSeq elem elemAt genericClosure getAttr hasAttr isAttrs isBool isInt isList isPath isString pathExists readFile replaceStrings @@ -73,7 +73,7 @@ let 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 seq lessThan + mod compare splitByAndCompare seq lessThan add functionArgs setFunctionArgs isFunction toFunction mirrorFunctionArgs toHexString toBaseDigits inPureEvalMode; inherit (self.fixedPoints) fix fix' converge extends composeExtensions From 8a6941dbef24b2172e52f291045c22e175e7a9d7 Mon Sep 17 00:00:00 2001 From: Silvan Mosberger Date: Thu, 20 Jun 2024 18:37:38 +0200 Subject: [PATCH 14/29] lib.sub: inherit from lib.trivial --- lib/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/default.nix b/lib/default.nix index c172f24c36e6..a322f9cd1434 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -68,12 +68,12 @@ let deepSeq elem elemAt genericClosure getAttr hasAttr isAttrs isBool isInt isList isPath isString pathExists readFile replaceStrings - sub trace; + 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 seq lessThan add + mod compare splitByAndCompare seq lessThan add sub functionArgs setFunctionArgs isFunction toFunction mirrorFunctionArgs toHexString toBaseDigits inPureEvalMode; inherit (self.fixedPoints) fix fix' converge extends composeExtensions From f341dca2a24c0deefea5eb6ed1e4cf0b3392fec9 Mon Sep 17 00:00:00 2001 From: Silvan Mosberger Date: Thu, 20 Jun 2024 18:47:59 +0200 Subject: [PATCH 15/29] lib.deepSeq: inherit from lib.trivial --- lib/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/default.nix b/lib/default.nix index a322f9cd1434..33d56a52dced 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -65,7 +65,7 @@ let kernel = callLibs ./kernel.nix; inherit (builtins) addErrorContext - deepSeq elem elemAt genericClosure getAttr + elem elemAt genericClosure getAttr hasAttr isAttrs isBool isInt isList isPath isString pathExists readFile replaceStrings trace; @@ -73,7 +73,7 @@ let 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 seq lessThan add sub + mod compare splitByAndCompare seq deepSeq lessThan add sub functionArgs setFunctionArgs isFunction toFunction mirrorFunctionArgs toHexString toBaseDigits inPureEvalMode; inherit (self.fixedPoints) fix fix' converge extends composeExtensions From 46b7bbb660cfe1a6107e4b42411cd1aa16901ead Mon Sep 17 00:00:00 2001 From: Silvan Mosberger Date: Thu, 20 Jun 2024 18:48:21 +0200 Subject: [PATCH 16/29] lib.elem: inherit from lib.lists --- lib/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/default.nix b/lib/default.nix index 33d56a52dced..6d2596ba8821 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -65,7 +65,7 @@ let kernel = callLibs ./kernel.nix; inherit (builtins) addErrorContext - elem elemAt genericClosure getAttr + elemAt genericClosure getAttr hasAttr isAttrs isBool isInt isList isPath isString pathExists readFile replaceStrings trace; @@ -94,7 +94,7 @@ let reverseList listDfs toposort sort sortOn naturalSort compareLists take drop sublist last init crossLists unique allUnique intersectLists subtractLists mutuallyExclusive groupBy groupBy' concatLists genList - length head tail; + length head tail elem; inherit (self.strings) concatStrings concatMapStrings concatImapStrings stringLength substring intersperse concatStringsSep concatMapStringsSep From 4bcc1d34504fb885f24944578e46a5e899ef53be Mon Sep 17 00:00:00 2001 From: Silvan Mosberger Date: Thu, 20 Jun 2024 18:50:35 +0200 Subject: [PATCH 17/29] lib.elemAt: inherit from lib.lists --- lib/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/default.nix b/lib/default.nix index 6d2596ba8821..3e771d100f9e 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -65,7 +65,7 @@ let kernel = callLibs ./kernel.nix; inherit (builtins) addErrorContext - elemAt genericClosure getAttr + genericClosure getAttr hasAttr isAttrs isBool isInt isList isPath isString pathExists readFile replaceStrings trace; @@ -94,7 +94,7 @@ let reverseList listDfs toposort sort sortOn naturalSort compareLists take drop sublist last init crossLists unique allUnique intersectLists subtractLists mutuallyExclusive groupBy groupBy' concatLists genList - length head tail elem; + length head tail elem elemAt; inherit (self.strings) concatStrings concatMapStrings concatImapStrings stringLength substring intersperse concatStringsSep concatMapStringsSep From c3b87461e73ab54ab3cd112f687098f706d0079d Mon Sep 17 00:00:00 2001 From: Silvan Mosberger Date: Thu, 20 Jun 2024 18:50:49 +0200 Subject: [PATCH 18/29] lib.hasAttr: inherit from lib.attrsets --- lib/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/default.nix b/lib/default.nix index 3e771d100f9e..f3bede7a827c 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -66,7 +66,7 @@ let inherit (builtins) addErrorContext genericClosure getAttr - hasAttr isAttrs isBool isInt isList isPath isString + isAttrs isBool isInt isList isPath isString pathExists readFile replaceStrings trace; inherit (self.trivial) id const pipe concat or and xor bitAnd bitOr bitXor @@ -87,7 +87,7 @@ let recursiveUpdate matchAttrs mergeAttrsList overrideExisting showAttrPath getOutput getBin getLib getDev getMan chooseDevOutputs zipWithNames zip recurseIntoAttrs dontRecurseIntoAttrs cartesianProduct cartesianProductOfSets - mapCartesianProduct updateManyAttrsByPath listToAttrs intersectAttrs removeAttrs; + mapCartesianProduct updateManyAttrsByPath listToAttrs hasAttr intersectAttrs removeAttrs; inherit (self.lists) singleton forEach map foldr fold foldl foldl' imap0 imap1 filter ifilter0 concatMap flatten remove findSingle findFirst any all count optional optionals toList range replicate partition zipListsWith zipLists From 53744d55cdb9e78e18bf2567707c61a00fb202a7 Mon Sep 17 00:00:00 2001 From: Silvan Mosberger Date: Thu, 20 Jun 2024 18:51:34 +0200 Subject: [PATCH 19/29] lib.isAttrs: inherit from lib.attrsets --- lib/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/default.nix b/lib/default.nix index f3bede7a827c..952474061bf3 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -66,7 +66,7 @@ let inherit (builtins) addErrorContext genericClosure getAttr - isAttrs isBool isInt isList isPath isString + isBool isInt isList isPath isString pathExists readFile replaceStrings trace; inherit (self.trivial) id const pipe concat or and xor bitAnd bitOr bitXor @@ -87,7 +87,7 @@ let recursiveUpdate matchAttrs mergeAttrsList overrideExisting showAttrPath getOutput getBin getLib getDev getMan chooseDevOutputs zipWithNames zip recurseIntoAttrs dontRecurseIntoAttrs cartesianProduct cartesianProductOfSets - mapCartesianProduct updateManyAttrsByPath listToAttrs hasAttr intersectAttrs removeAttrs; + mapCartesianProduct updateManyAttrsByPath listToAttrs hasAttr isAttrs intersectAttrs removeAttrs; inherit (self.lists) singleton forEach map foldr fold foldl foldl' imap0 imap1 filter ifilter0 concatMap flatten remove findSingle findFirst any all count optional optionals toList range replicate partition zipListsWith zipLists From 5313a054d37732fc86b1e588a1316ab28e04fcd1 Mon Sep 17 00:00:00 2001 From: Silvan Mosberger Date: Thu, 20 Jun 2024 18:52:16 +0200 Subject: [PATCH 20/29] lib.isBool: inherit from lib.trivial --- lib/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/default.nix b/lib/default.nix index 952474061bf3..19813f568c99 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -66,7 +66,7 @@ let inherit (builtins) addErrorContext genericClosure getAttr - isBool isInt isList isPath isString + isInt isList isPath isString pathExists readFile replaceStrings trace; inherit (self.trivial) id const pipe concat or and xor bitAnd bitOr bitXor @@ -75,7 +75,7 @@ let info showWarnings nixpkgsVersion version isInOldestRelease mod compare splitByAndCompare seq deepSeq lessThan add sub functionArgs setFunctionArgs isFunction toFunction mirrorFunctionArgs - toHexString toBaseDigits inPureEvalMode; + toHexString toBaseDigits inPureEvalMode isBool; inherit (self.fixedPoints) fix fix' converge extends composeExtensions composeManyExtensions makeExtensible makeExtensibleWithCustomName; inherit (self.attrsets) attrByPath hasAttrByPath setAttrByPath From fa82e813f10165305b4a2387e6e54080c9e5c486 Mon Sep 17 00:00:00 2001 From: Silvan Mosberger Date: Thu, 20 Jun 2024 18:52:46 +0200 Subject: [PATCH 21/29] lib.isInt: inherit from lib.trivial --- lib/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/default.nix b/lib/default.nix index 19813f568c99..1da52266dce8 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -66,7 +66,7 @@ let inherit (builtins) addErrorContext genericClosure getAttr - isInt isList isPath isString + isList isPath isString pathExists readFile replaceStrings trace; inherit (self.trivial) id const pipe concat or and xor bitAnd bitOr bitXor @@ -75,7 +75,7 @@ let info showWarnings nixpkgsVersion version isInOldestRelease mod compare splitByAndCompare seq deepSeq lessThan add sub functionArgs setFunctionArgs isFunction toFunction mirrorFunctionArgs - toHexString toBaseDigits inPureEvalMode isBool; + toHexString toBaseDigits inPureEvalMode isBool isInt; inherit (self.fixedPoints) fix fix' converge extends composeExtensions composeManyExtensions makeExtensible makeExtensibleWithCustomName; inherit (self.attrsets) attrByPath hasAttrByPath setAttrByPath From 6f7324c1f0d48b0bf5ea34b7bd5787e125fef3c8 Mon Sep 17 00:00:00 2001 From: Silvan Mosberger Date: Thu, 20 Jun 2024 18:53:11 +0200 Subject: [PATCH 22/29] lib.isList: inherit from lib.lists --- lib/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/default.nix b/lib/default.nix index 1da52266dce8..a6b7b596871b 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -66,7 +66,7 @@ let inherit (builtins) addErrorContext genericClosure getAttr - isList isPath isString + isPath isString pathExists readFile replaceStrings trace; inherit (self.trivial) id const pipe concat or and xor bitAnd bitOr bitXor @@ -94,7 +94,7 @@ let reverseList listDfs toposort sort sortOn naturalSort compareLists take drop sublist last init crossLists unique allUnique intersectLists subtractLists mutuallyExclusive groupBy groupBy' concatLists genList - length head tail elem elemAt; + length head tail elem elemAt isList; inherit (self.strings) concatStrings concatMapStrings concatImapStrings stringLength substring intersperse concatStringsSep concatMapStringsSep From 94a863973a82c16357d6680d361b008a8de608b4 Mon Sep 17 00:00:00 2001 From: Silvan Mosberger Date: Thu, 20 Jun 2024 18:54:32 +0200 Subject: [PATCH 23/29] lib.isString: inherit from lib.strings --- lib/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/default.nix b/lib/default.nix index a6b7b596871b..6228935965b0 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -66,7 +66,7 @@ let inherit (builtins) addErrorContext genericClosure getAttr - isPath isString + isPath pathExists readFile replaceStrings trace; inherit (self.trivial) id const pipe concat or and xor bitAnd bitOr bitXor @@ -96,7 +96,7 @@ let subtractLists mutuallyExclusive groupBy groupBy' concatLists genList length head tail elem elemAt isList; inherit (self.strings) concatStrings concatMapStrings concatImapStrings - stringLength substring + stringLength substring isString intersperse concatStringsSep concatMapStringsSep concatImapStringsSep concatLines makeSearchPath makeSearchPathOutput makeLibraryPath makeIncludePath makeBinPath optionalString From 574611fe0bfb213816ecd9ca7eb7045edc2b0e22 Mon Sep 17 00:00:00 2001 From: Silvan Mosberger Date: Thu, 20 Jun 2024 18:55:26 +0200 Subject: [PATCH 24/29] lib.getAttr: inherit from lib.attrsets --- lib/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/default.nix b/lib/default.nix index 6228935965b0..f003d7110c93 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -65,7 +65,7 @@ let kernel = callLibs ./kernel.nix; inherit (builtins) addErrorContext - genericClosure getAttr + genericClosure isPath pathExists readFile replaceStrings trace; @@ -87,7 +87,7 @@ let recursiveUpdate matchAttrs mergeAttrsList overrideExisting showAttrPath getOutput getBin getLib getDev getMan chooseDevOutputs zipWithNames zip recurseIntoAttrs dontRecurseIntoAttrs cartesianProduct cartesianProductOfSets - mapCartesianProduct updateManyAttrsByPath listToAttrs hasAttr isAttrs intersectAttrs removeAttrs; + mapCartesianProduct updateManyAttrsByPath listToAttrs hasAttr getAttr isAttrs intersectAttrs removeAttrs; inherit (self.lists) singleton forEach map foldr fold foldl foldl' imap0 imap1 filter ifilter0 concatMap flatten remove findSingle findFirst any all count optional optionals toList range replicate partition zipListsWith zipLists From e3faf23ba61f20a9e8491191c5fd6f780d6cf9ce Mon Sep 17 00:00:00 2001 From: Silvan Mosberger Date: Thu, 20 Jun 2024 18:56:20 +0200 Subject: [PATCH 25/29] lib.pathExists: inherit from lib.trivial --- lib/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/default.nix b/lib/default.nix index f003d7110c93..2136e831563a 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -67,7 +67,7 @@ let inherit (builtins) addErrorContext genericClosure isPath - pathExists readFile replaceStrings + readFile replaceStrings trace; inherit (self.trivial) id const pipe concat or and xor bitAnd bitOr bitXor bitNot boolToString mergeAttrs flip mapNullable inNixShell isFloat min max @@ -75,7 +75,7 @@ let info showWarnings nixpkgsVersion version isInOldestRelease mod compare splitByAndCompare seq deepSeq lessThan add sub functionArgs setFunctionArgs isFunction toFunction mirrorFunctionArgs - toHexString toBaseDigits inPureEvalMode isBool isInt; + toHexString toBaseDigits inPureEvalMode isBool isInt pathExists; inherit (self.fixedPoints) fix fix' converge extends composeExtensions composeManyExtensions makeExtensible makeExtensibleWithCustomName; inherit (self.attrsets) attrByPath hasAttrByPath setAttrByPath From e3b0f46af9d0c57661e5a85e8482ecbdee1d6ed8 Mon Sep 17 00:00:00 2001 From: Silvan Mosberger Date: Thu, 20 Jun 2024 18:57:10 +0200 Subject: [PATCH 26/29] lib.genericClosure: inherit from lib.trivial --- lib/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/default.nix b/lib/default.nix index 2136e831563a..dc85dd57e024 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -65,7 +65,6 @@ let kernel = callLibs ./kernel.nix; inherit (builtins) addErrorContext - genericClosure isPath readFile replaceStrings trace; @@ -75,7 +74,8 @@ let info showWarnings nixpkgsVersion version isInOldestRelease mod compare splitByAndCompare seq deepSeq lessThan add sub functionArgs setFunctionArgs isFunction toFunction mirrorFunctionArgs - toHexString toBaseDigits inPureEvalMode isBool isInt pathExists; + toHexString toBaseDigits inPureEvalMode isBool isInt pathExists + genericClosure; inherit (self.fixedPoints) fix fix' converge extends composeExtensions composeManyExtensions makeExtensible makeExtensibleWithCustomName; inherit (self.attrsets) attrByPath hasAttrByPath setAttrByPath From d3c09b9327427dc4bec632ca60924e5dc4e05607 Mon Sep 17 00:00:00 2001 From: Silvan Mosberger Date: Thu, 20 Jun 2024 18:57:40 +0200 Subject: [PATCH 27/29] lib.readFile: inherit from lib.trivial --- lib/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/default.nix b/lib/default.nix index dc85dd57e024..20a7cf93b370 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -66,7 +66,7 @@ let inherit (builtins) addErrorContext isPath - readFile replaceStrings + replaceStrings trace; inherit (self.trivial) id const pipe concat or and xor bitAnd bitOr bitXor bitNot boolToString mergeAttrs flip mapNullable inNixShell isFloat min max @@ -75,7 +75,7 @@ let mod compare splitByAndCompare seq deepSeq lessThan add sub functionArgs setFunctionArgs isFunction toFunction mirrorFunctionArgs toHexString toBaseDigits inPureEvalMode isBool isInt pathExists - genericClosure; + genericClosure readFile; inherit (self.fixedPoints) fix fix' converge extends composeExtensions composeManyExtensions makeExtensible makeExtensibleWithCustomName; inherit (self.attrsets) attrByPath hasAttrByPath setAttrByPath From 1e4f04d4d62701f5f8dfd37f3c535e8d2b2fbb97 Mon Sep 17 00:00:00 2001 From: Silvan Mosberger Date: Thu, 20 Jun 2024 18:58:03 +0200 Subject: [PATCH 28/29] lib.replaceStrings: inherit from lib.strings --- lib/default.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/default.nix b/lib/default.nix index 20a7cf93b370..5d98a58836f8 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -66,7 +66,6 @@ let inherit (builtins) addErrorContext isPath - replaceStrings trace; inherit (self.trivial) id const pipe concat or and xor bitAnd bitOr bitXor bitNot boolToString mergeAttrs flip mapNullable inNixShell isFloat min max @@ -96,7 +95,7 @@ let subtractLists mutuallyExclusive groupBy groupBy' concatLists genList length head tail elem elemAt isList; inherit (self.strings) concatStrings concatMapStrings concatImapStrings - stringLength substring isString + stringLength substring isString replaceStrings intersperse concatStringsSep concatMapStringsSep concatImapStringsSep concatLines makeSearchPath makeSearchPathOutput makeLibraryPath makeIncludePath makeBinPath optionalString From 5d892a8ea51442a8403d043335daa53c39527f42 Mon Sep 17 00:00:00 2001 From: Silvan Mosberger Date: Thu, 20 Jun 2024 19:01:19 +0200 Subject: [PATCH 29/29] lib: Add a TODO for builtins not available in sub-libraries --- lib/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/default.nix b/lib/default.nix index 5d98a58836f8..9c6f886c9ee4 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -64,9 +64,9 @@ let # linux kernel configuration kernel = callLibs ./kernel.nix; - inherit (builtins) addErrorContext - isPath - 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