Skip to main content

Crate flake_edit

Crate flake_edit 

Source
Expand description

Edit Nix flake inputs from Rust.

edit::FlakeEdit is the entry point: build one with edit::FlakeEdit::from_text, queue or apply change::Changes, and read back the new source via edit::FlakeEdit::source_text or edit::ApplyOutcome.

Supporting modules:

  • walk traverses the rnix CST and applies edits.
  • input models a flake input and its input::Follows declarations.
  • lock parses flake.lock for revs, follows targets, and nested input discovery via lock::FlakeLock::nested_inputs.
  • forge talks to GitHub / Gitea / Forgejo, normalizes versions, and applies pin/unpin updates (forge::api, forge::channel, forge::version, forge::update).
  • config loads flake-edit.toml.
  • cache persists URI completion state.
  • validate runs pre-edit lint passes. Error is the crate-wide error.

Feature flags: application (default) enables the binary-side glue (app, cli, diff, tui) and pulls in clap, ratatui, crossterm, diffy, etc. Library-only consumers can disable it with --no-default-features to compile the pure edit / walk / forge surface.

Re-exports§

pub use error::Error;

Modules§

app
cache
change
cli
config
diff
Wrapper for diffing the changes
edit
error
follows
Follows-graph types: typed attribute paths and the edge graph built from them.
forge
Forge interactions: talking to GitHub / Gitea / Forgejo, choosing between semver tags and channel branches, normalizing versions, and applying pin/unpin updates to flake.nix.
input
lock
tui
uri
validate
Validation for Nix flake expressions.
walk
CST walking and mutation for flake.nix files.