scrubOptionValue
lib.options.scrubOptionValue
Docs pulled from | This Revision | 4 days ago
This function recursively removes all derivation attributes from
x except for the name attribute.
This is to make the generation of options.xml much more
efficient: the XML representation of derivations is very large
(on the order of megabytes) and is not actually used by the
manual generator.
This function was made obsolete by renderOptionValue and is kept for compatibility with out-of-tree code.
Inputs
- x
- 
1. Function argument 
Noogle detected
Implementation
The following is the current implementation of this function.
scrubOptionValue =
    x:
    if isDerivation x then
      {
        type = "derivation";
        drvPath = x.name;
        outPath = x.name;
        name = x.name;
      }
    else if isList x then
      map scrubOptionValue x
    else if isAttrs x then
      mapAttrs (n: v: scrubOptionValue v) (removeAttrs x [ "_args" ])
    else
      x;