Noogλe

From
To
On this page

availableOn

lib.meta.availableOn

Docs pulled from | This Revision | about 6 hours ago


Check if a package is available on a given platform.

A package is available on a platform if both

  1. One of meta.platforms pattern matches the given platform, or meta.platforms is not present.

  2. None of meta.badPlatforms pattern 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 [ ]);