Nix store path, hash, and error types shared by FlakeHub Cache services.
The crate provides:
nix_store::StorePathandnix_store::StorePathHash: parsed, validated store paths and their 32-character base name hashes.hash::Hash: SHA-256 hashes with Nix's base16 and base32 encodings.hash::Error: the parsing error returned byHash::from_typed.StoreErrorandStoreResult: the errors returned by the store path operations above.
cargo add --git https://github.com/DeterminateSystems/flakehub-cache-types flakehub-cache-typesuse flakehub_cache_types::nix_store::StorePathHash;
let hash = StorePathHash::new("ib3sh3pcz10wsmavxvkdbayhqivbghlq")?;cxx(off by default): implementsFrom<cxx::Exception>forStoreError, for use with C++ bindings to the Nix libraries.
nix develop provides a Rust toolchain, and direnv loads it
automatically. Run the tests with cargo test. CI enforces cargo fmt,
cargo clippy, cargo deny, and editorconfig conformance.
These types derive from Attic by Zhaofeng Li and the Attic contributors. Licensed under the Apache License, Version 2.0; see LICENSE.