Back to directory

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

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.

More in Libraries

See all 292
  • OpenDecision

    deepanwadhwa.github.io

    An open-source Python package that answers typed questions about application state or documents using a local natural-language-inference model, returning structured choice, score, yes/no or evidence-relation values instead of free text.

  • TradeCanvas

    bonguynvan.github.io

    A zero-dependency canvas charting engine for building TradingView-style trading charts in JavaScript, with 66 technical indicators, 24 drawing tools, 17 chart types, and real-time streaming.

  • 3d retro graphics

    3d-retro.com

    A free, CC0-licensed library of copy-paste retro 3D and demoscene graphics effects, such as plasma, raytracing, and voxel terrain, runnable as WebGL 1 or plain 2D canvas.