Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
126 changes: 124 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ members = [
"harmonia-store-remote",
"harmonia-store-aterm",
"harmonia-file-core",
"harmonia-file-fd",
"harmonia-file-io-pure",
"harmonia-file-nar",
"harmonia-protocol",
"harmonia-protocol-derive",
Expand Down Expand Up @@ -45,6 +47,7 @@ async-stream = "0.3"
blake3 = "1.8"
bstr = "1.11"
bytes = "1.11"
cap-std = "3"
data-encoding = "2.11"
derive_more = { version = "2.1", features = [ "display" ] }
ed25519-dalek = "2"
Expand Down Expand Up @@ -98,6 +101,8 @@ tokio-test = "0.4"

# Internal crates
harmonia-file-core = { path = "harmonia-file-core" }
harmonia-file-fd = { path = "harmonia-file-fd" }
harmonia-file-io-pure = { path = "harmonia-file-io-pure" }
harmonia-file-nar = { path = "harmonia-file-nar" }
harmonia-protocol = { path = "harmonia-protocol" }
harmonia-protocol-derive = { path = "harmonia-protocol-derive" }
Expand Down
24 changes: 16 additions & 8 deletions docs/architecture/harmonia-store-structure.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ composed.
┌────────────────────────────┬─────────────────────────┐
│ Format / File │ Database │
│ harmonia-file-nar │ harmonia-store-db │
│ harmonia-file-core │ │
│ NAR pack/unpack, types │ SQLite store metadata │
│ harmonia-file-core/io/fd │ │
│ NAR pack/unpack, file I/O │ SQLite store metadata │
└────────────────────────────┴─────────────────────────┘
┌──────────────────────────────────────────────────────┐
Expand Down Expand Up @@ -51,7 +51,9 @@ composed.
| [harmonia-store-aterm](../../harmonia-store-aterm/) | ATerm derivation parser |
| [harmonia-store-path-info](../../harmonia-store-path-info/) | ValidPathInfo types (pure) |
| [harmonia-store-db](../../harmonia-store-db/README.md) | SQLite store metadata |
| [harmonia-file-core](../../harmonia-file-core/) | File tree types and serde (pure) |
| [harmonia-file-core](../../harmonia-file-core/) | File tree data types and serde |
| [harmonia-file-io-pure](../../harmonia-file-io-pure/) | Async IO traits, in-memory impls, listing |
| [harmonia-file-fd](../../harmonia-file-fd/) | Filesystem source/sink via cap-std |
| [harmonia-file-nar](../../harmonia-file-nar/README.md) | NAR archive format |
| [harmonia-protocol](../../harmonia-protocol/README.md) | Daemon wire protocol |
| [harmonia-protocol-derive](../../harmonia-protocol-derive/README.md) | Derive macros for protocol types |
Expand Down Expand Up @@ -100,16 +102,20 @@ graph BT
end
subgraph "File"
file-core
file-fd
file-io-pure
file-nar
end
bench
client
ssh-store
file-nar --> file-core
file-nar --> utils-io
file-io-pure --> file-core
utils-hash --> utils-base-encoding
utils-signature --> utils-base-encoding
file-fd --> file-io-pure
store-path --> utils-hash
file-nar --> file-fd
file-nar --> utils-io
store-content-address --> store-path
store-ref-scan --> store-path
store-derivation --> store-content-address
Expand Down Expand Up @@ -155,9 +161,11 @@ intra-workspace dependencies.
- `harmonia-store-derivation`: derivations, derived paths, placeholders, realisations — depends on `harmonia-store-content-address`.
- `harmonia-store-aterm`, `harmonia-store-path-info`, `harmonia-store-build-result`, `harmonia-store-nar-info`: format/metadata crates kept separate to avoid coupling.

**File** (`harmonia-file-core`, `harmonia-file-nar`)
- `harmonia-file-core`: pure file tree types and serde matching nix's JSON format.
- `harmonia-file-nar`: NAR pack/unpack against generic `AsyncRead`/`AsyncWrite`. Streaming; never requires the full input in memory. Knows nothing about derivations or signatures.
**File** (`harmonia-file-core`, `harmonia-file-io-pure`, `harmonia-file-fd`, `harmonia-file-nar`)
- `harmonia-file-core`: pure file tree data types (`FileTree`, `FileSystemObject`), serde matching nix's JSON format.
- `harmonia-file-io-pure`: async IO traits (`FileSystemSource`/`FileSystemSink`), in-memory implementations, listing functions.
- `harmonia-file-fd`: real filesystem source/sink via `cap-std` (openat, no symlink following).
- `harmonia-file-nar`: NAR pack/unpack against generic `FileSystemSource`/`FileSystemSink` traits. Streaming; never requires the full input in memory. Knows nothing about derivations or signatures.

**Database** (`harmonia-store-db`)
- Schema matches Nix's `db.sqlite` exactly.
Expand Down
3 changes: 3 additions & 0 deletions harmonia-cache/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ edition.workspace = true
license.workspace = true
homepage.workspace = true
repository.workspace = true
readme = "README.md"

[[bin]]
name = "harmonia-cache"
Expand Down Expand Up @@ -42,6 +43,8 @@ bytes = { workspace = true }
futures-core = { workspace = true }
futures-util = { workspace = true }
harmonia-file-core = { workspace = true }
harmonia-file-fd = { workspace = true }
harmonia-file-io-pure = { workspace = true }
harmonia-file-nar = { workspace = true }
harmonia-store-db = { workspace = true }
harmonia-store-derivation = { workspace = true }
Expand Down
1 change: 1 addition & 0 deletions harmonia-cache/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ pub enum ServeError {
},

#[error("Access denied: {path}")]
#[allow(dead_code)]
AccessDenied { path: String },
}

Expand Down
Loading
Loading