From bc4584e0bbb061e4cd6be10c890a68097265189e Mon Sep 17 00:00:00 2001 From: Adam Joseph Date: Fri, 23 Dec 2022 20:18:18 -0800 Subject: [PATCH] lib/meta.nix: make availableOn work when meta.platforms is missing Currently, `lib.meta.availableOn` will fail for packages which omit `meta.platforms` (e.g. `djbdns`). This commit avoids that failure. --- lib/meta.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/meta.nix b/lib/meta.nix index 74b94211552b6..76c6c8d23f1b1 100644 --- a/lib/meta.nix +++ b/lib/meta.nix @@ -97,7 +97,7 @@ rec { 2. None of `meta.badPlatforms` pattern matches the given platform. */ availableOn = platform: pkg: - lib.any (platformMatch platform) pkg.meta.platforms && + ((!pkg?meta.platforms) || lib.any (platformMatch platform) pkg.meta.platforms) && lib.all (elem: !platformMatch platform elem) (pkg.meta.badPlatforms or []); /* Get the corresponding attribute in lib.licenses