From e47764618a233f7cbf7c401250c1d3398eccc639 Mon Sep 17 00:00:00 2001 From: Aaron Honeycutt Date: Wed, 9 Apr 2025 20:42:49 -0600 Subject: [PATCH] add garrus to the host menu --- src/main.rs | 42 +++++++++++++++++------------------------- 1 file changed, 17 insertions(+), 25 deletions(-) diff --git a/src/main.rs b/src/main.rs index 284b544..b80f143 100644 --- a/src/main.rs +++ b/src/main.rs @@ -49,29 +49,6 @@ fn format_drive(drive_name: &str) -> rsfdisk::Result<()> { fn mount_parts() {} -// fn grab_configs() { -// let mut flakeConfig = Easy::new(); -// let mut mainConfig = Easy::new(); -// let mut homeConfig = Easy::new(); - -// flakeConfig.url("https://gitlab.com/ahoneybun/nix-configs/-/raw/main/flake.nix").unwrap(); -// mainConfig.url("https://gitlab.com/ahoneybun/nix-configs/-/raw/main/configuration.nix").unwrap(); -// homeConfig.url("https://gitlab.com/ahoneybun/nix-configs/-/raw/main/home.nix").unwrap(); - -// let mut flakeFile = File::create("flake.nix").unwrap(); -// let mut mainFile = File::create("configuration.nix").unwrap(); -// let mut homeFile = File::create("home.nix").unwrap(); - -// { -// let mut flakeTransfer = easy.transfer(); -// transfer.write_function(|data| { -// flakeFile.write_all(data).unwrap(); -// Ok(data.len()) -// }).unwrap(); -// transfer.perform().unwrap(); -// } -// } - fn grab_flake() { let mut easy = Easy::new(); easy.url("https://gitlab.com/ahoneybun/nix-configs/-/raw/main/flake.nix").unwrap(); @@ -172,7 +149,7 @@ fn main() { loop { println!(""); println!("Host selection"); - println!("1. Device 1"); + println!("1. Lemur Pro 13 (Garrus)"); println!("2. Device 2"); println!("3. Device 3"); println!(""); @@ -183,7 +160,22 @@ fn main() { io::stdin().read_line(&mut choice).unwrap(); match choice.trim() { - "1" => println!("Hello, world!"), + "1" => { + let mut garrusConfig = Easy::new(); + garrusConfig.url("https://gitlab.com/ahoneybun/nix-configs/-/raw/main/hosts/x86_64/garrus/configuration.nix").unwrap(); + + let mut configFile = File::create("configuration.nix").unwrap(); + + { + let mut transfer = garrusConfig.transfer(); + transfer.write_function(|data| { + configFile.write_all(data).unwrap(); + Ok(data.len()) + }).unwrap(); + transfer.perform().unwrap(); + } + break + } "2" => { println!("2 + 2 = {}", 2 + 2); },