# nix-meta

A Nix library for embedding, querying and stripping metadata on Nix expressions, storing arbitrary data such as a package's description, license or maintainers under a _meta attribute and locating the right binding to attach it to.

nix-meta embeds metadata as an attribute set under a `_meta` key in a Nix expression, then traverses the expression to find, update or remove it. What goes inside `_meta`, such as a description, license, maintainers or changelog, is left entirely up to the caller.

It works out which binding-capable node should hold the metadata for a given expression: an attribute set holds it directly, a `let` expression's own bindings hold it if there is no inner attribute set, and wrapper expressions such as `with`, `assert` or a lambda are peeled off until a container is found; an expression with nowhere to attach a binding, such as a bare lambda body, is left untouched.

It exposes `get`, `set` and `remove` functions over one or more parsed expressions, is used as a flake input, and is built on and re-exports the API of a companion project, nix-ast.

Website: https://github.com/z1-0/nix-meta
