any2nix-api
JSON-based Nix Converter API
What is any2nix-api?
any2nix-api is the API offering of any2nix, a Rust library for converting strings in various file formats to Nix. It can be run standalone or embedded into another axum application.

Supported formats
any2nix-api supports converting from the following formats into Nix expressions:
Quick look
# Output:
#
# {"nix":"{\n package = {\n name = \"any2nix\";\n };\n}"}
Interactive OpenAPI documentation is available at /docs when the utoipa-swagger-ui feature is enabled.
Installation
Install with Cargo
Install on macOS
macOS builds of any2nix-api are available at the releases tab.
Install on Linux
Look for your favorite package manager in the list of supported repositories:
Additionally, Linux builds are available at the releases tab.
Install on Windows
Windows builds of any2nix-api are available at the releases tab.
Run using Docker
A docker image is available for any2nix-api.
After running this, the API will be available at http://localhost:3000.
Crate features
All format parsers are enabled by default. You can disable default features and enable only the formats or integrations you need:
| Feature | Description | Default |
|---|---|---|
ini |
Support for converting INI strings | Yes |
json |
Support for converting JSON strings | Yes |
toml |
Support for converting TOML strings | Yes |
yaml |
Support for converting YAML strings | Yes |
trace |
Support for tracing | No |
utoipa |
Support for OpenAPI | No |
utoipa-swagger-ui |
User interface for the API at the /docs endpoint |
No |
License
All code is licensed GPL 3.0 or later. The distribution workflow is based on cargo-dist and is thus licensed MIT or Apache 2.0.
Anything that is not code is CC-BY-4.0.
This software family is REUSE compliant.