Skip to content

jim3692/yaml.nix

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

YAML Support for Nix

Since Nix does not officially support YAML yet (NixOS/nix#7340), I created this flake which runs yq for conversions between JSON and YAML.

Such a solution is not ideal to be merged to nixpkgs, as it's based on the concept of IFD.

Installation

In flake.nix:

{
  inputs = {
    # ...
    yaml.url = "github:jim3692/yaml.nix";
  };

  outputs = { yaml, ... }: {
    specialArgs = {
      lib = nixpkgs.lib.extend (
        final: prev: { yaml = yaml.lib; }
      );
      # ...
    };
    # ...
  };
}

Usage

lib.yaml.fromYaml

lib.yaml.fromYaml :: path -> set

Description: It takes a YAML file path as parameter and returns the resulting attrSet

lib.yaml.toYaml

lib.yaml.toYaml :: set -> path

Description: It takes an attrSet as parameter and returns the path of the generated YAML file

About

YAML Support for Nix

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages