snix/web/content/docs/guides/use-as-library.md
Paul Meyer 0b717258f0 fix(website): remove all windows line endings
Change-Id: I340486d90a1fb74e26b31f1f330f61ee2b570c43
Reviewed-on: https://cl.snix.dev/c/snix/+/30139
Autosubmit: Paul Meyer <katexochen0@gmail.com>
Reviewed-by: Florian Klink <flokli@flokli.de>
Tested-by: besadii
2025-03-19 11:15:01 +00:00

1.2 KiB

title slug description summary date lastmod draft weight toc
Use as a library use-as-library 2025-03-14T14:14:35+01:00 2025-03-14T14:14:35+01:00 false 13 true

If you want to use (parts of) Snix in your own project, you can simply refer to it using cargo and specifying the git sources. cargo will pin the exact rev in Cargo.lock. See The Cargo Book for details.

We do not publish to crates.io yet, due to the interfaces still being a bit in flux.

For example, to add nix-compat, exposing a lot of Nix data types and formats, add the following line to your Cargo.toml's [dependencies]':

nix-compat = { git = "https://git.snix.dev/snix/snix.git" }

{{}} Keep in mind some crates have additional requirements on their environment.

For example, snix-castore and snix-store need to have access to a protobuf compiler and the proto defintions (setting PROTO_ROOT usually). tvix-build wants TVIX_BUILD_SANDBOX_SHELL to be set, etc.

Check each crates' build.rs scripts for details. {{}}