harmonia-store-core (Core)
Purpose: Pure store semantics for Nix, agnostic to I/O and implementation strategy.
Overview
This crate provides the fundamental types and pure computation logic for working with the Nix store. It is intentionally I/O-free - all operations are pure functions that operate on values, enabling easy testing and composition.
This is the "business logic" of Nix, pure and simple. It should be usable with a wide variety of implementation strategies, not forcing any decisions. It should also be widely usable by other tools which need to engage with Nix (e.g. tools that create dynamic derivations from other build systems' build plans).
Contents (from Nix.rs):
store_path/- Store path parsing, validation, manipulationderivation/- Derivation (.drv) file format and semanticsderived_path/- Paths derived from derivations (built outputs)signature/- Cryptographic signatures for store pathsrealisation/- Store path realisation trackingplaceholder/- Placeholder computation for derivation inputslog/- Build log types
Key Characteristics
- No
async, no filesystem access, no network - All operations are pure computations
- Can be tested without IO
- Can be compiled to WASM
Example
use ;
use Derivation;
// Pure computation - no IO
;
;
;
Feature Flags
test: Enables proptestArbitraryimplementations for property-based testing