query
On this page

writeYAML

pkgs.writers.writeYAML

Functor
Docs pulled from | This Revision | 18 days ago


Contribute
Enhance the ecosystem with your expertise! Contribute to fill the gaps in documentation. Your input can make a difference.

Noogle detected

This is a Functor

Learn about functors

Implementation

The following is the current implementation of this function.

name: value:
        pkgs.callPackage (
          { runCommand, remarshal_0_17 }:
          runCommand name
            {
              nativeBuildInputs = [ remarshal_0_17 ];
              inherit value;
              preferLocalBuild = true;
              __structuredAttrs = true;
            }
            ''
              json2yaml ${
                # attributes with null values are omitted from the JSON with structured attrs
                # yaml_1_1Null test keeps this in check
                if value == null then ''<(echo "null")'' else ''--unwrap value "$NIX_ATTRS_JSON_FILE"''
              } "$out"
            ''
        ) { }