1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
//! Read, edit, and generate Guix Scheme files (channels.scm, system config.scm) from Rust.
//!
//! ```
//! use guix_scheme::{Channel, ChannelsFile};
//! let mut cf = ChannelsFile::parse("(list)").unwrap();
//! cf.add_channel(&Channel {
//! name: "pantherx".into(),
//! url: "https://codeberg.org/gofranz/panther.git".into(),
//! branch: Some("master".into()),
//! commit: None,
//! introduction_commit: Some("54b4056ac571611892c743b65f4c47dc298c49da".into()),
//! introduction_fingerprint: Some("A36A D41E ECC7 A871 1003 5D24 524F EB1A 9D33 C9CB".into()),
//! }).unwrap();
//! assert!(cf.to_string().contains("(name 'pantherx)"));
//! ```
//!
//! # Boundaries
//!
//! String in, string out: this crate parses `&str` and renders back to
//! `String`, and does no file IO. Reading files, writing them atomically,
//! keeping backups, and refusing symlinks or store-managed paths are the
//! caller's job.
//!
//! Edits are byte-preserving. Running on a lossless CST (see `scheme-edit`),
//! adding or removing a channel keeps every untouched byte and comment intact
//! and only formats the node it inserts, instead of reflowing the whole file.
pub use Channel;
pub use ;
pub use Error;
pub use ;
pub use ;
pub use ;
/// Cheap syntax check: `Ok(())` iff SRC parses as Scheme.
///
/// This only verifies the surface syntax (balanced delimiters, valid
/// tokens); it does not evaluate the form or resolve any Guix bindings.
/// For a deeper check that actually loads the config, enable the
/// `guile-check` feature.