{"repo":"z1-0/nix-ast","free":true,"listed":false,"github":"https://github.com/z1-0/nix-ast","clone":"git clone https://github.com/z1-0/nix-ast.git","description":"A Nix library for parsing, inspecting, and transforming AST","language":"Haskell","stars":77,"topics":["ast","cli","code-analysis","code-generation","flake","haskell","metaprogramming","nix","nixos","parser"],"license":"BSD-3-Clause","category":"cli-tools","readme_excerpt":"nix-ast A Nix library that parses, inspects, transforms, and evaluates Nix Abstract Syntax Trees (AST) using Haskell's hnix parser. nix-ast provides the full Nix AST API in Nix itself (via IFD, Import From Derivation) and uses hnix's Haskell parser and evaluator internally. Parse any Nix expression into a structured AST, traverse and transform it with pure Nix functions, render it back to source code, or evaluate it, all from within your Nix expressions. --- Features Feature Description ----------------------------- -------------------------------------------------------------------------------------- Parse Parse any Nix expression (file, string, or stdin) into a structured, typed AST Render Convert an AST back to formatted, importable Nix code Eval Evaluate ASTs using hnix's evaluator and get the results as JSON values toAST Convert native Nix values (ints, strings, lists, attrsets) to AST nodes (pure, no IFD) fromAST Convert an AST back to a native Nix value, the inverse of toAST (pure, no IFD) Pattern Matching Type-safe tag-based dispatch with match ast { Tag = handler; = fallback; } Traversal Recursive transform , rewrite , universe , children / rebuild , and contexts Type-checked Constructors All mk builders validate argument types at runtime with descriptive error messages CLI Tool nix-ast eval / nix-ast parse / nix-ast render for shell/pipe workflows --- Quick Start Using the Nix Library (Flake) Add nix-ast to your flake inputs: The library provides three main API grou","default_branch":null,"files":null,"tree":[],"storefront":"/r/z1-0","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/z1-0/nix-ast/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}