harmonia_store_core/lib.rs
1// SPDX-FileCopyrightText: 2024 griff
2// SPDX-FileCopyrightText: 2025 Jörg Thalheim
3// SPDX-License-Identifier: EUPL-1.2 OR MIT
4//
5// This crate is derived from Nix.rs (https://github.com/griff/Nix.rs)
6// Upstream commit: f5d129b71bb30b476ce21e6da2a53dcb28607a89
7
8//! Core Nix store semantics.
9//!
10//! This crate provides the fundamental types and pure computation logic for working
11//! with the Nix store. It is intentionally IO-free - all operations are pure functions
12//! that operate on values, enabling easy testing and composition.
13//!
14//! **Architecture**: This is the Core Layer in Harmonia's store architecture.
15//! See `docs/architecture/harmonia-store-structure.md` for details.
16//!
17//! # Key Modules
18//!
19//! - `hash` - Content addressing, hash types, hash computation
20//! - `store_path` - Store path types, parsing, validation
21//! - `derivation` - Derivation (.drv) file format and semantics
22//! - `signature` - Cryptographic signatures for store paths
23//! - `realisation` - Store path realisation tracking
24//!
25//! # Design Principles
26//!
27//! 1. **No IO**: No filesystem, no network, minimal `async`
28//! 2. **Pure functions**: Deterministic, testable, referentially transparent
29//! 3. **Explicit errors**: All fallible operations return `Result`
30//! 4. **Memory-bounded**: Stream-friendly, no unbounded buffers
31
32// Type alias for byte strings
33pub type ByteString = bytes::Bytes;
34
35pub mod derivation;
36pub mod derived_path;
37pub mod placeholder;
38pub mod realisation;
39pub mod signature;
40pub mod store_path;
41
42#[cfg(any(test, feature = "test"))]
43pub mod test;