query
On this page

evaluateNamedProperty

lib.licenses.evaluateNamedProperty

Docs pulled from | This Revision | 29 minutes ago


Nixpkgs manual

Evaluate a license expression for a given property name. The property must be defined as a boolean attribute of all licenses passed.

Example

evaluateNamedProperty "deprecated" true (with lib.licenses; AND [ ncsa (WITH asl20 llvm-exception) ])

Type

evaluateProperty :: String -> Bool -> AttrSet -> Bool

Arguments

  • [name] name of the attribute to check
  • [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.

evaluateNamedProperty =
    name: permissive:
    let
      OR = if permissive then any else all;
      AND = if permissive then all else any;
      evaluateComplexProperty = handleComplexProperty (evaluateNamedProperty name permissive) AND OR;
    in
    license:
    if license.licenseType == "simple" then license.${name} else evaluateComplexProperty license;