flake_edit/lib.rs
1//! Edit Nix flake inputs from Rust.
2//!
3//! [`edit::FlakeEdit`] is the entry point: build one with
4//! [`edit::FlakeEdit::from_text`], queue or apply [`change::Change`]s, and read
5//! back the new source via [`edit::FlakeEdit::source_text`] or
6//! [`edit::ApplyOutcome`].
7//!
8//! Supporting modules:
9//! - [`walk`] traverses the `rnix` CST and applies edits.
10//! - [`input`] models a flake input and its [`input::Follows`] declarations.
11//! - [`lock`] parses `flake.lock` for revs, follows targets, and nested input
12//! discovery via [`lock::FlakeLock::nested_inputs`].
13//! - [`forge`] talks to GitHub / Gitea / Forgejo, normalizes versions, and
14//! applies pin/unpin updates (`forge::api`, `forge::channel`,
15//! `forge::version`, `forge::update`).
16//! - [`config`] loads `flake-edit.toml`.
17//! - [`cache`] persists URI completion state.
18//! - [`validate`] runs pre-edit lint passes. [`Error`] is the crate-wide
19//! error.
20//!
21//! Feature flags: `application` (default) enables the binary-side glue
22//! ([`app`], [`cli`], [`diff`], [`tui`]) and pulls in `clap`, `ratatui`,
23//! `crossterm`, `diffy`, etc. Library-only consumers can disable it with
24//! `--no-default-features` to compile the pure edit / walk / forge surface.
25//! `sizes` (implied by `application`) adds [`lock::sizes`] store-size estimation.
26
27#[cfg(feature = "application")]
28pub mod app;
29pub mod cache;
30pub mod change;
31#[cfg(feature = "application")]
32pub mod cli;
33pub mod config;
34#[cfg(feature = "application")]
35pub mod diff;
36pub mod edit;
37pub mod error;
38pub mod follows;
39pub mod forge;
40pub mod input;
41pub mod lock;
42#[cfg(feature = "application")]
43pub mod tui;
44pub mod uri;
45pub mod validate;
46pub mod walk;
47
48pub use error::Error;