summaryrefslogtreecommitdiff
path: root/lib/customisation.nix
diff options
context:
space:
mode:
authorRobert Hensing <robert@roberthensing.nl>2023-01-29 23:39:27 +0100
committerRobert Hensing <robert@roberthensing.nl>2023-01-30 00:35:34 +0100
commit473ac9692e09451ef6025e50ccfa19efe5ae69a9 (patch)
treed530656502147112cd360731c53d663485024275 /lib/customisation.nix
parentpkg-config-data.json: Remove m and pthread (diff)
downloadnixpkgs-473ac9692e09451ef6025e50ccfa19efe5ae69a9.tar.gz
lib.hydraJob: Tolerate null
By allowing null, we allow code to avoid filterAttrs, improving laziness in real world use cases. Specifically, this strategy prevents infinite recursion errors, performance issues and possibly other errors that are unrelated to the user's code.
Diffstat (limited to 'lib/customisation.nix')
-rw-r--r--lib/customisation.nix3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/customisation.nix b/lib/customisation.nix
index 101c9e62b9e6..42d711cf5fb9 100644
--- a/lib/customisation.nix
+++ b/lib/customisation.nix
@@ -252,7 +252,8 @@ rec {
outputsList = map makeOutput outputs;
drv' = (lib.head outputsList).value;
- in lib.deepSeq drv' drv';
+ in if drv == null then null else
+ lib.deepSeq drv' drv';
/* Make a set of packages with a common scope. All packages called
with the provided `callPackage` will be evaluated with the same