query
On this page

getOutput

lib.attrsets.getOutput

Docs pulled from | This Revision | about 1 hour ago


Get a package output. If no output is found, fallback to .out and then to the default. The function is idempotent: getOutput "b" (getOutput "a" p) == getOutput "a" p.

Inputs

output

1. Function argument

pkg

2. Function argument

Type

getOutput :: String -> :: Derivation -> Derivation

Examples

lib.attrsets.getOutput usage example

"${getOutput "dev" pkgs.openssl}"
=> "/nix/store/9rz8gxhzf8sw4kf2j2f1grr49w8zx5vj-openssl-1.0.1r-dev"

Noogle detected

Aliases

Implementation

The following is the current implementation of this function.

getOutput = output: pkg:
    if ! pkg ? outputSpecified || ! pkg.outputSpecified
      then pkg.${output} or pkg.out or pkg
      else pkg;