Skip to main content

Crate nix_flake_lock

Crate nix_flake_lock 

Source
Expand description

Fast, high-level access to Nix flake lock files.

The crate parses directly into a compact indexed graph. It does not build a generic JSON tree and does not require Nix or its C++ libraries at runtime. Unescaped strings borrow from the input buffer, while canonical serialization writes directly to a caller-provided byte vector.

The 0.1 API intentionally exposes a read-only graph. Use LockFile::into_owned to detach a parsed graph from its input lifetime; this does not make the graph mutable.

§Example

use nix_flake_lock::LockFile;

let lock = LockFile::parse(bytes)?;
lock.validate()?;
let canonical = lock.to_nix_bytes();
assert_eq!(LockFile::parse(&canonical)?, lock);

Structs§

Attr
One name-value pair from a fetcher attribute set.
AttrSet
A sorted flat fetcher attribute map.
Error
A parse error carrying a byte offset into the input document.
Input
A named outgoing edge from a node.
InputPath
A path of input names, used by follows edges and graph lookup.
Limits
Resource limits applied while parsing untrusted lock files.
LockFile
A parsed Nix flake lock file.
LockedNode
The lock metadata associated with a non-root node.
Node
A node in the compact lock-file graph.
NodeId
An index into a lock file’s compact node arena.

Enums§

AttrValue
A fetcher attribute value. Nix restricts these values to this flat set.
Change
One semantic change between two lock-file input graphs.
Edge
An outgoing edge from a lock-file node.
EdgeValue
The semantic value attached to a changed input edge.
ErrorKind
The category and associated context of a parse failure.
NodeKind
The root or locked-node-specific portion of a node.
ResolveError
An error encountered while resolving an input path.
ValidationError
A graph-integrity error found by LockFile::validate.

Type Aliases§

OwnedLockFile
An owned lock file that does not borrow its input buffer.