mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-10 01:53:09 +09:00
Merge pull request #291909 from cdmistman/lib-meta-available-on-doc-example
lib.meta.availableOn: add example in documentation
This commit is contained in:
commit
78d6e84385
1 changed files with 4 additions and 0 deletions
|
@ -116,6 +116,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) &&
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue