query
On this page

evaluateProperty

lib.licenses.evaluateProperty

Docs pulled from | This Revision | 12 minutes ago


Nixpkgs manual

Evaluate a license expression for a given predicate.

Example

evaluateProperty (x: x.free) true (with lib.licenses; AND [ ncsa (WITH asl20 llvm-exception) ])

Type

evaluateProperty :: Function -> Bool -> AttrSet -> Bool

Arguments

  • [predicate] checks for each license included in the license expression
  • [permissive] whether to apply checks permissive or reciprocal
  • [license] license expression to check

Noogle detected

Implementation

The following is the current implementation of this function.

evaluateProperty =
    predicate: permissive:
    let
      OR = if permissive then any else all;
      AND = if permissive then all else any;
      evaluateComplexProperty = handleComplexProperty (evaluateProperty predicate permissive) AND OR;
    in
    license:
    if license.licenseType == "simple" then predicate license else evaluateComplexProperty license;