availableOn
lib.meta.availableOn
Docs pulled from | This Revision | 4 days ago
Check if a package is available on a given platform.
A package is available on a platform if both
-
One of
meta.platformspattern matches the given platform, ormeta.platformsis not present. -
None of
meta.badPlatformspattern matches the given platform.
Inputs
platform-
1. Function argument
pkg-
2. Function argument
Examples
lib.meta.availableOn usage example
lib.meta.availableOn { system = "aarch64-darwin"; } pkg.zsh
=> true
Noogle detected
Implementation
The following is the current implementation of this function.
availableOn =
platform: pkg:
((!pkg ? meta.platforms) || any (platformMatch platform) pkg.meta.platforms)
&& all (elem: !platformMatch platform elem) (pkg.meta.badPlatforms or [ ]);