From 0cd5007ae7e29e6c560bfdd92da56c5c4a8aaa6c Mon Sep 17 00:00:00 2001 From: Aaron Honeycutt Date: Sat, 19 Apr 2025 17:25:52 -0600 Subject: [PATCH 1/2] add boot permission fix --- src/main.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/main.rs b/src/main.rs index c1b5ffc..b51cf5c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -228,6 +228,17 @@ fn main() { .output() .expect("Failed to move nix files over"); + // Fixes a security issue with boot + let _boot_fix = Command::new("sed") + .arg("-i") + .arg(r#"/fsType = "vfat"/ { + n + s/\(options = \[.*\)\]/\1"umask=0077 "]/ + }"#) + .arg("/mnt/etc/nixos/hardware-configuration.nix") + .output() + .expect("Failed to apply boot fix"); + // Host selection loop { println!(""); From c070fcac90f1bb8db33a5dba1d3942912672c686 Mon Sep 17 00:00:00 2001 From: Aaron Honeycutt Date: Sat, 19 Apr 2025 22:38:12 -0600 Subject: [PATCH 2/2] remove quit as it is after the formatting so pointless --- src/main.rs | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/src/main.rs b/src/main.rs index b51cf5c..16020b7 100644 --- a/src/main.rs +++ b/src/main.rs @@ -233,12 +233,12 @@ fn main() { .arg("-i") .arg(r#"/fsType = "vfat"/ { n - s/\(options = \[.*\)\]/\1"umask=0077 "]/ + s/\(options = \[.*\)\]/\1"umask=0077 "]/ }"#) .arg("/mnt/etc/nixos/hardware-configuration.nix") .output() .expect("Failed to apply boot fix"); - + // Host selection loop { println!(""); @@ -246,8 +246,7 @@ fn main() { println!("---------------"); println!(""); println!("1. Lemur Pro 13 (Garrus)"); - println!("2. Device 2"); - println!("3. Quit"); + println!("2. Generic"); println!(""); println!("Enter your host for installation:"); @@ -292,12 +291,20 @@ fn main() { break } "2" => { - println!("Nix the world!"); - }, - "3" => { - println!("Goodbye!"); + let mut nixos_install = Command::new("nixos-install") + .arg("--flake") + .arg("/mnt/etc/nixos#nixos") + .arg("--no-root-passwd") + .stdout(Stdio::inherit()) + .stderr(Stdio::inherit()) + .spawn() + .unwrap(); + + let install_status = nixos_install.wait(); + println!("Exited with status {:?}", install_status); + break; - }, + }, _ => println!("Invalid choice, try again."), } }