Crates.io | libnixstore |
lib.rs | libnixstore |
version | 0.4.0 |
source | src |
created_at | 2022-06-28 13:28:07.319688 |
updated_at | 2022-12-06 10:03:43.911626 |
description | Rust friendly bindings to nixos nix-store library |
homepage | https://github.com/helsinki-systems/harmonia |
repository | https://github.com/helsinki-systems/harmonia.git |
max_upload_size | |
id | 614850 |
size | 32,030 |
Is a library that provides simple access to your local nix store, based on c++ bindings. It mimics the already available perl bindings but also adds bindings on top, that might be useful.
Note: This project provides bindings, this makes the project automatically unsafe.
Supported nix version:
It is only available for systems that have the nix package manager installed. To achieve this you should setup a simple shell.nix
with import <nixpkgs> { };
stdenv.mkDerivation {
name = "xyz";
nativeBuildInputs = [ rustc cargo gcc pkg-config ];
buildInputs = [
# required
nix
nlohmann_json
libsodium
boost
# additional packages you might need
rustfmt
clippy
# ...
];
RUST_SRC_PATH = "${pkgs.rust.packages.stable.rustPlatform.rustLibSrc}";
}
fn main() {
libnixstore::init();
println!("{}", libnixstore::get_store_dir());
}