query
On this page

getContext

lib.getContext

Primop
Docs pulled from | This Revision | about 1 hour ago

Takes 1 arguments

s


Return the string context of s.

The string context tracks references to derivations within a string. It is represented as an attribute set of store derivation paths mapping to output names.

Using string interpolation on a derivation adds that derivation to the string context. For example,

builtins.getContext "${derivation { name = "a"; builder = "b"; system = "c"; }}"

evaluates to

{ "/nix/store/arhvjaf6zmlyn8vh8fgn55rpwnxq0n7l-a.drv" = { outputs = [ "out" ]; }; }

Noogle detected

Aliases

Implementation

This function is implemented in c++ and is part of the native nix runtime.