#nix #bindings #build #store #state #nixrs

sys nixrs-sys

nix bindings for Rust

1 unstable release

0.1.0 May 25, 2024

#137 in #nix


Used in nixrs

MIT license

2KB

nixrs

Nix binding for Rust

Examples

See examples

cd nixrs && cargo run --example eval
use nixrs::{init, state::State, store::Store};

fn main() -> anyhow::Result<()> {
    init()?;
    let mut state = State::new(Store::new("daemon")?)?;
    let libclang = &state.eval("(import <nixpkgs> {}).libclang")?;
    dbg!(state.build(libclang)?);
    Ok(())
}

No runtime deps

~0–1.9MB
~37K SLoC