ALPHA: wire is a tool to deploy nixos systems wire.althaea.zone/

add typos checker

+63 -41
+2 -2
CHANGELOG.md
··· 111 111 - There is a new package output, `wire-small`, for testing purposes. 112 112 It only compiles the key agent for the host that builds `wire-small`. 113 113 - `--no-progress` now defaults to true if stdin does not refer to a tty (unix pipelines, in CI). 114 - - Added an error for the internal hive evluation parse failure. 114 + - Added an error for the internal hive evaluation parse failure. 115 115 - The `inspect` command now has `show` as an alias. 116 116 - Remove `log` command as there are currently no plans to implement the feature 117 117 - The `completions` command is now hidden from the help page 118 118 119 119 ### Fixed 120 120 121 - - A non-existant key owner user/group would not default to gid/uid `0`. 121 + - A non-existent key owner user/group would not default to gid/uid `0`. 122 122 - Keys can now be deployed to localhost. 123 123 124 124 ## [0.2.0] - 2025-04-21
+1 -1
README.md
··· 18 18 │ ├── cli 19 19 │ │ └── Rust binary, using `lib` 20 20 │ └── key_agent 21 - │ └── Rust binary ran on a target node. recieves key file bytes and metadata w/ protobuf over SSH stdin 21 + │ └── Rust binary ran on a target node. receives key file bytes and metadata w/ protobuf over SSH stdin 22 22 ├── doc 23 23 │ └── a [vitepress](https://vitepress.dev/) site 24 24 ├── runtime
+2 -2
doc/default.nix
··· 9 9 packages = { 10 10 docs = pkgs.callPackage ./package.nix { 11 11 mode = "stable"; 12 - inherit (self'.packages) wire-small-dev wire-dignostics-md; 12 + inherit (self'.packages) wire-small-dev wire-diagnostics-md; 13 13 }; 14 14 15 15 docs-unstable = pkgs.callPackage ./package.nix { 16 - inherit (self'.packages) wire-small-dev wire-dignostics-md; 16 + inherit (self'.packages) wire-small-dev wire-diagnostics-md; 17 17 }; 18 18 }; 19 19 };
+1 -1
doc/guides/keys.md
··· 23 23 24 24 ### Prerequisites 25 25 26 - wire uses a Rust binary to recieve encrypted key data, so your deploying 26 + wire uses a Rust binary to receive encrypted key data, so your deploying 27 27 user must be trusted or you must add garnix as a trusted public key: 28 28 29 29 ```nix
+1 -1
doc/guides/targeting.md
··· 21 21 22 22 ## Reading from Stdin 23 23 24 - Passing `--on -` will read whitespace-seperated nodes and tags from stdin. This 24 + Passing `--on -` will read whitespace-separated nodes and tags from stdin. This 25 25 can be combined with normal `--on` usage. 26 26 27 27 For example:
+2 -2
doc/package.nix
··· 3 3 nixosOptionsDoc, 4 4 runCommand, 5 5 wire-small-dev, 6 - wire-dignostics-md, 6 + wire-diagnostics-md, 7 7 nix, 8 8 nodejs, 9 9 pnpm, ··· 56 56 }; 57 57 patchPhase = '' 58 58 cat ${optionsDoc} >> ./reference/module.md 59 - cat ${wire-dignostics-md} >> ./reference/errors.md 59 + cat ${wire-diagnostics-md} >> ./reference/errors.md 60 60 wire inspect --markdown-help > ./reference/cli.md 61 61 ''; 62 62 buildPhase = "pnpm run build > build.log 2>&1";
+6
nix/hooks.nix
··· 31 31 name = "nix fmt"; 32 32 entry = "${lib.getExe config.formatter} --no-cache"; 33 33 }; 34 + typos = { 35 + enable = true; 36 + settings = { 37 + configPath = "typos.toml"; 38 + }; 39 + }; 34 40 35 41 }; 36 42
+2 -2
runtime/module/options.nix
··· 84 84 85 85 replaceUnknownProfiles = lib.mkOption { 86 86 type = types.bool; 87 - description = "No-op, colmena compatability"; 87 + description = "No-op, colmena compatibility"; 88 88 default = true; 89 89 }; 90 90 91 91 sshOptions = lib.mkOption { 92 92 type = types.listOf types.str; 93 - description = "No-op, colmena compatability"; 93 + description = "No-op, colmena compatibility"; 94 94 default = [ ]; 95 95 }; 96 96
+2 -2
tests/nix/default.nix
··· 86 86 let 87 87 # TODO: Update once #126 is solved. 88 88 nixPackage = nixpkgs.legacyPackages.lix; 89 - sanitizeName = 89 + sanitiseName = 90 90 str: lib.strings.sanitizeDerivationName (builtins.replaceStrings [ "." ] [ "_" ] str); 91 - identifier = sanitizeName "${nixpkgs.legacyPackages.lib.trivial.release}-${nixPackage.name}"; 91 + identifier = sanitiseName "${nixpkgs.legacyPackages.lib.trivial.release}-${nixPackage.name}"; 92 92 path = "tests/nix/suite/${testName}"; 93 93 94 94 flakeDirFileset = lib.fileset.toSource {
+5 -5
tests/nix/suite/test_keys/default.nix
··· 53 53 def perform_routine(target, target_object, non_interactive): 54 54 test_keys(target, target_object, non_interactive) 55 55 56 - # only check systemd units on receiver since deployer applys are one time only 56 + # only check systemd units on receiver since deployer apply's are one time only 57 57 if target == "receiver": 58 58 target_object.succeed("systemctl start source_string_name-key.path") 59 59 target_object.succeed("systemctl start command-key.path") ··· 87 87 (deployer, new_deployer_store_objects), 88 88 (receiver, new_receiver_store_objects), 89 89 ]: 90 - assert_store_not_posioned(node, "hello_world_source", objects) 91 - assert_store_not_posioned(node, "hello_world_file", objects) 92 - assert_store_not_posioned(node, "hello_world_command", objects) 93 - assert_store_not_posioned(node, "string_from_environment", objects) 90 + assert_store_not_poisoned(node, "hello_world_source", objects) 91 + assert_store_not_poisoned(node, "hello_world_file", objects) 92 + assert_store_not_poisoned(node, "hello_world_command", objects) 93 + assert_store_not_poisoned(node, "string_from_environment", objects) 94 94 ''; 95 95 }; 96 96 }
+1 -1
tests/nix/tools.py
··· 6 6 return set(machine.succeed("ls /nix/store").strip().split("\n")) 7 7 8 8 9 - def assert_store_not_posioned(machine: Machine, poison: str, objects: set[str]): 9 + def assert_store_not_poisoned(machine: Machine, poison: str, objects: set[str]): 10 10 paths = list(map(lambda n: f"/nix/store/{n}", objects)) 11 11 12 12 machine.succeed("which rg")
+16
typos.toml
··· 1 + [files] 2 + extend-exclude = ["COPYING"] 3 + 4 + [default] 5 + locale = "en-au" 6 + 7 + [type.nix] 8 + # nixpkgs 9 + extend-ignore-re = ["authorizedKeys", "sanitizeDerivationName"] 10 + 11 + [type.md] 12 + extend-ignore-re = ["authorizedKeys", "Initialized empty Git"] 13 + 14 + [type.rust.extend-words] 15 + # serde 16 + serialize = "serialize"
+1 -1
wire/cli/default.nix
··· 81 81 paths = [ self'.packages.wire-unwrapped-perf ]; 82 82 }; 83 83 84 - wire-dignostics-md = self'.packages.wire-unwrapped.overrideAttrs { 84 + wire-diagnostics-md = self'.packages.wire-unwrapped.overrideAttrs { 85 85 DIAGNOSTICS_MD_OUTPUT = "/build/source"; 86 86 installPhase = '' 87 87 mv /build/source/DIAGNOSTICS.md $out
+1 -1
wire/cli/src/cli.rs
··· 137 137 138 138 /// List of literal node names, a literal `-`, or `@` prefixed tags. 139 139 /// 140 - /// `-` will read additional values from stdin, seperated by whitespace. 140 + /// `-` will read additional values from stdin, separated by whitespace. 141 141 /// Any `-` implies `--non-interactive`. 142 142 #[arg(short, long, value_name = "NODE | @TAG | `-`", num_args = 1..)] 143 143 pub on: Vec<ApplyTarget>,
+1 -1
wire/cli/src/main.rs
··· 44 44 } 45 45 46 46 if !matches!(args.command, cli::Commands::Completions { .. }) && !check_nix_available() { 47 - miette::bail!("Nix is not availabile on this system."); 47 + miette::bail!("Nix is not available on this system."); 48 48 } 49 49 50 50 let location = get_hive_location(args.path)?;
+5 -5
wire/lib/build.rs
··· 21 21 } 22 22 23 23 #[derive(Debug)] 24 - struct DerviedError { 24 + struct DerivedError { 25 25 code: Option<String>, 26 26 help: Option<String>, 27 27 message: Option<String>, 28 28 doc_string: String, 29 29 } 30 30 31 - impl Display for DerviedError { 31 + impl Display for DerivedError { 32 32 fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { 33 33 write!( 34 34 f, ··· 61 61 } 62 62 } 63 63 64 - impl DerviedError { 64 + impl DerivedError { 65 65 fn get_error(&mut self, list: &MetaList) -> Result<(), miette::Error> { 66 66 if list.path.segments.last().unwrap().ident != "error" { 67 67 return Err(miette!("Not an error")); ··· 153 153 let syntax_tree = parse_file(&src) 154 154 .into_diagnostic() 155 155 .wrap_err("parsing errors.rs")?; 156 - let mut entries: Vec<DerviedError> = Vec::new(); 156 + let mut entries: Vec<DerivedError> = Vec::new(); 157 157 158 158 for item in &syntax_tree.items { 159 159 if let Item::Enum(ItemEnum { variants, .. }) = item { 160 160 for variant in variants { 161 - let mut entry = DerviedError { 161 + let mut entry = DerivedError { 162 162 code: None, 163 163 help: None, 164 164 message: None,
+1 -1
wire/lib/src/commands/pty/mod.rs
··· 307 307 let mut command = if let Some(target) = arguments.target { 308 308 let mut command = create_int_ssh_command(target, arguments.modifiers)?; 309 309 310 - // force ssh to use our pesudo terminal 310 + // force ssh to use our pseudo terminal 311 311 command.arg("-tt"); 312 312 313 313 command
+4 -4
wire/lib/src/errors.rs
··· 121 121 } 122 122 123 123 #[derive(Debug, Diagnostic, Error)] 124 - pub enum HiveInitializationError { 124 + pub enum HiveInitialisationError { 125 125 #[diagnostic( 126 126 code(wire::hive_init::NoHiveFound), 127 127 help( ··· 213 213 WaitForStatus(#[source] std::io::Error), 214 214 215 215 #[diagnostic( 216 - code(wire::detatched::NoHandle), 216 + code(wire::detached::NoHandle), 217 217 help("This should never happen, please create an issue!"), 218 218 url("{DOCS_URL}#{}", self.code().unwrap()) 219 219 )] ··· 247 247 url("{DOCS_URL}#{}", self.code().unwrap()), 248 248 help("please create an issue!"), 249 249 )] 250 - #[error("Thread paniced")] 250 + #[error("Thread panicked")] 251 251 ThreadPanic, 252 252 253 253 #[diagnostic( ··· 289 289 pub enum HiveLibError { 290 290 #[error(transparent)] 291 291 #[diagnostic(transparent)] 292 - HiveInitializationError(HiveInitializationError), 292 + HiveInitialisationError(HiveInitialisationError), 293 293 294 294 #[error(transparent)] 295 295 #[diagnostic(transparent)]
+8 -8
wire/lib/src/hive/mod.rs
··· 18 18 use tracing::{info, instrument}; 19 19 20 20 use crate::commands::common::evaluate_hive_attribute; 21 - use crate::errors::{HiveInitializationError, HiveLocationError}; 21 + use crate::errors::{HiveInitialisationError, HiveLocationError}; 22 22 use crate::{EvalGoal, HiveLibError, SubCommandModifiers}; 23 23 pub mod node; 24 24 pub mod steps; ··· 60 60 let output = evaluate_hive_attribute(location, &EvalGoal::Inspect, modifiers).await?; 61 61 62 62 let hive: Hive = serde_json::from_str(&output).map_err(|err| { 63 - HiveLibError::HiveInitializationError(HiveInitializationError::ParseEvaluateError(err)) 63 + HiveLibError::HiveInitialisationError(HiveInitialisationError::ParseEvaluateError(err)) 64 64 })?; 65 65 66 66 Ok(hive) ··· 75 75 76 76 self.nodes 77 77 .get_mut(&Name(Arc::from(node.clone()))) 78 - .ok_or(HiveLibError::HiveInitializationError( 79 - HiveInitializationError::NodeDoesNotExist(node.clone()), 78 + .ok_or(HiveLibError::HiveInitialisationError( 79 + HiveInitialisationError::NodeDoesNotExist(node.clone()), 80 80 ))? 81 81 .build_remotely = false; 82 82 } ··· 371 371 .unwrap(); 372 372 373 373 assert_matches!( 374 - hive.force_always_local(vec!["non-existant".to_string()]), 375 - Err(HiveLibError::HiveInitializationError( 376 - HiveInitializationError::NodeDoesNotExist(node) 377 - )) if node == "non-existant" 374 + hive.force_always_local(vec!["non-existent".to_string()]), 375 + Err(HiveLibError::HiveInitialisationError( 376 + HiveInitialisationError::NodeDoesNotExist(node) 377 + )) if node == "non-existent" 378 378 ); 379 379 380 380 for node in hive.nodes.values() {
+1 -1
wire/lib/src/hive/steps/keys.rs
··· 144 144 length: buf 145 145 .len() 146 146 .try_into() 147 - .expect("Failed to conver usize buf length to i32"), 147 + .expect("Failed to convert usize buf length to i32"), 148 148 user: key.user.clone(), 149 149 group: key.group.clone(), 150 150 permissions: get_u32_permission(key)?,