lib.meta.availableOn: add example in documentation

This commit is contained in:
Colton Donnelly 2024-02-27 12:31:58 -05:00
parent 19bb95a427
commit 3698be4ee6

View file

@ -112,6 +112,10 @@ rec {
platform, or `meta.platforms` is not present. platform, or `meta.platforms` is not present.
2. None of `meta.badPlatforms` pattern matches the given platform. 2. None of `meta.badPlatforms` pattern matches the given platform.
Example:
lib.meta.availableOn { system = "aarch64-darwin"; } pkg.zsh
=> true
*/ */
availableOn = platform: pkg: availableOn = platform: pkg:
((!pkg?meta.platforms) || any (platformMatch platform) pkg.meta.platforms) && ((!pkg?meta.platforms) || any (platformMatch platform) pkg.meta.platforms) &&