Function add_flake_input

Source
pub fn add_flake_input(key: &str, url: &str) -> Result<(), Error>
Expand description

@brief Safely adds a new input to the flake.nix file.

This function parses the flake.nix file, locates the inputs attribute set, checks if the specified input already exists, and if not, inserts the new input.

@param key The key/name of the flake input to add. @param url The URL of the flake input. @return Result<(), Error> Returns Ok(()) on success, or an Error if the operation fails.