From 382e4e3f063cbaa61ea4114c78a212249b81c291 Mon Sep 17 00:00:00 2001 From: Aaron Honeycutt Date: Wed, 9 Apr 2025 19:16:05 -0600 Subject: [PATCH 01/12] add nix-shell for development --- shell.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shell.nix b/shell.nix index 826e6ba..df7b7fc 100644 --- a/shell.nix +++ b/shell.nix @@ -21,6 +21,6 @@ export LIBCLANG_PATH="${pkgs.llvmPackages.libclang.lib}/lib" export CLANG_PATH="${pkgs.llvmPackages.clang}/bin/clang" export RUST_BACKTRACE=1 - echo "Ready to make some rust!" + echo "We're ready to make some Rust!" ''; } From ea7303c2eee5a92ca2a6234f1b3bcf19858195ec Mon Sep 17 00:00:00 2001 From: Aaron Honeycutt Date: Wed, 9 Apr 2025 19:55:19 -0600 Subject: [PATCH 02/12] update shell file and code for curl --- shell.nix | 1 + src/main.rs | 71 +++++++++++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 67 insertions(+), 5 deletions(-) diff --git a/shell.nix b/shell.nix index df7b7fc..f3174fb 100644 --- a/shell.nix +++ b/shell.nix @@ -13,6 +13,7 @@ llvmPackages.clang # System + openssl pkg-config util-linux ]; diff --git a/src/main.rs b/src/main.rs index e6674ad..c922407 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,9 +1,13 @@ use std::io; +use std::io::{stdout, Write}; +use std::fs::File; use sys_metrics::disks; use rsfdisk::fdisk::Fdisk; use rsfdisk::core::partition_table::PartitionTableKind; use rsfdisk::core::partition::{Guid, Partition, PartitionKind, PartitionList}; +use curl::easy::Easy; + fn format_drive(drive_name: &str) -> rsfdisk::Result<()> { let mut disk = Fdisk::builder() .assign_device(drive_name) @@ -31,7 +35,7 @@ fn format_drive(drive_name: &str) -> rsfdisk::Result<()> { .name("Root") .size_in_sectors(499_033_071_616) .build()?; - + let _ = disk.partition_add(root)?; disk.partition_table_write_to_disk()?; @@ -39,12 +43,64 @@ fn format_drive(drive_name: &str) -> rsfdisk::Result<()> { Ok(()) } -fn mount_parts() { - +fn mount_parts() {} + +fn grab_flake() { + let mut easy = Easy::new(); + easy.url("https://gitlab.com/ahoneybun/nix-configs/-/raw/main/flake.nix").unwrap(); + + let mut file = File::create("flake.nix").unwrap(); + + { + let mut transfer = easy.transfer(); + transfer.write_function(|data| { + file.write_all(data).unwrap(); + Ok(data.len()) + }).unwrap(); + transfer.perform().unwrap(); + } +} + +fn grab_config() { + let mut easy = Easy::new(); + easy.url("https://gitlab.com/ahoneybun/nix-configs/-/raw/main/configuration.nix").unwrap(); + + let mut file = File::create("configuration.nix").unwrap(); + + { + let mut transfer = easy.transfer(); + transfer.write_function(|data| { + file.write_all(data).unwrap(); + Ok(data.len()) + }).unwrap(); + transfer.perform().unwrap(); + } +} + +fn grab_home() { + let mut easy = Easy::new(); + easy.url("https://gitlab.com/ahoneybun/nix-configs/-/raw/main/home.nix").unwrap(); + + let mut file = File::create("home.nix").unwrap(); + + { + let mut transfer = easy.transfer(); + transfer.write_function(|data| { + file.write_all(data).unwrap(); + Ok(data.len()) + }).unwrap(); + transfer.perform().unwrap(); + } } fn main() { + println!("--------------------------------------"); + println!("| Welcome to the Nyxi Installer 2.0! |"); + println!("--------------------------------------"); + println!(""); + println!("Availble disks for installation:"); + println!("---------------------------------"); println!(""); match disks::get_physical_ioblocks() { @@ -57,7 +113,7 @@ fn main() { } let mut drive_name = String::new(); - + println!(""); println!("Use the full drive path such as /dev/nvme0n1 or /dev/sda"); println!("Which drive do we want to use for this installation?: {}", drive_name); @@ -65,7 +121,7 @@ fn main() { io::stdin() .read_line(&mut drive_name) .expect("Failed to read line"); - + let drive_name = drive_name.trim(); // let deposit_number: f64 = deposit_amount.parse().expect("Input not an integer"); @@ -73,4 +129,9 @@ fn main() { // Partitioning the selected drive format_drive(drive_name); + // Download nix files + grab_flake(); + grab_config(); + grab_home(); + } From 8ddbfe05d850e2c8f90dd1a9f3c57b219adfafa1 Mon Sep 17 00:00:00 2001 From: Aaron Honeycutt Date: Wed, 9 Apr 2025 20:22:29 -0600 Subject: [PATCH 03/12] add Command for testing and testing for a flash drive --- Cargo.lock | 101 ++++++++++++++++++++++++++++++++++++++++++++++++++-- Cargo.toml | 1 + src/main.rs | 41 ++++++++++++++++++++- 3 files changed, 139 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0089cb2..4453c35 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -87,6 +87,36 @@ version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" +[[package]] +name = "curl" +version = "0.4.47" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9fb4d13a1be2b58f14d60adba57c9834b78c62fd86c3e76a148f732686e9265" +dependencies = [ + "curl-sys", + "libc", + "openssl-probe", + "openssl-sys", + "schannel", + "socket2", + "windows-sys 0.52.0", +] + +[[package]] +name = "curl-sys" +version = "0.4.80+curl-8.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55f7df2eac63200c3ab25bde3b2268ef2ee56af3d238e76d61f01c3c49bff734" +dependencies = [ + "cc", + "libc", + "libz-sys", + "openssl-sys", + "pkg-config", + "vcpkg", + "windows-sys 0.52.0", +] + [[package]] name = "either" version = "1.15.0" @@ -138,7 +168,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" dependencies = [ "libc", - "windows-sys", + "windows-sys 0.59.0", ] [[package]] @@ -159,7 +189,7 @@ version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589533453244b0995c858700322199b2becb13b627df2851f64a2775d024abcf" dependencies = [ - "windows-sys", + "windows-sys 0.59.0", ] [[package]] @@ -210,6 +240,18 @@ dependencies = [ "windows-targets", ] +[[package]] +name = "libz-sys" +version = "1.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b70e7a7df205e92a1a4cd9aaae7898dac0aa555503cc0a649494d0d60e7651d" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + [[package]] name = "linux-raw-sys" version = "0.4.15" @@ -287,6 +329,7 @@ dependencies = [ name = "nyxi-installer" version = "2.0.0" dependencies = [ + "curl", "rsfdisk", "sys_metrics", ] @@ -297,6 +340,24 @@ version = "1.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d75b0bedcc4fe52caa0e03d9f1151a323e4aa5e2d78ba3580400cd3c9e2bc4bc" +[[package]] +name = "openssl-probe" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e" + +[[package]] +name = "openssl-sys" +version = "0.9.107" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8288979acd84749c744a9014b4382d42b8f7b2592847b5afb2ed29e5d16ede07" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + [[package]] name = "peeking_take_while" version = "0.1.2" @@ -420,7 +481,16 @@ dependencies = [ "errno", "libc", "linux-raw-sys", - "windows-sys", + "windows-sys 0.59.0", +] + +[[package]] +name = "schannel" +version = "0.1.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f29ebaa345f945cec9fbbc532eb307f0fdad8161f281b6369539c8d84876b3d" +dependencies = [ + "windows-sys 0.59.0", ] [[package]] @@ -449,6 +519,16 @@ version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" +[[package]] +name = "socket2" +version = "0.5.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f5fd57c80058a56cf5c777ab8a126398ece8e442983605d280a44ce79d0edef" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + [[package]] name = "syn" version = "1.0.109" @@ -549,6 +629,12 @@ version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + [[package]] name = "which" version = "4.4.2" @@ -561,6 +647,15 @@ dependencies = [ "rustix", ] +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets", +] + [[package]] name = "windows-sys" version = "0.59.0" diff --git a/Cargo.toml b/Cargo.toml index 6017b19..f5d8dd9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,5 +4,6 @@ version = "2.0.0" edition = "2021" [dependencies] +curl = "0.4.47" rsfdisk = "0.1.0" sys_metrics = "0.2.7" diff --git a/src/main.rs b/src/main.rs index c922407..5a5319e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,6 +1,7 @@ use std::io; use std::io::{stdout, Write}; use std::fs::File; +use std::process::Command; use sys_metrics::disks; use rsfdisk::fdisk::Fdisk; use rsfdisk::core::partition_table::PartitionTableKind; @@ -33,7 +34,10 @@ fn format_drive(drive_name: &str) -> rsfdisk::Result<()> { let root = Partition::builder() .partition_type(partition_type) .name("Root") - .size_in_sectors(499_033_071_616) + // 132,120,576 sectors for a 64GB flash drive + .size_in_sectors(132_120_576) + // 500GB + //.size_in_sectors(499_033_071_61) .build()?; let _ = disk.partition_add(root)?; @@ -45,6 +49,29 @@ 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(); @@ -93,6 +120,15 @@ fn grab_home() { } } +fn nix_gen() { + let output = Command::new("nixos-generate-config") + .arg("no-file-systems") + .arg("--root") + .arg("/mnt") + .output() + .expect("Failed to execute command"); +} + fn main() { println!("--------------------------------------"); println!("| Welcome to the Nyxi Installer 2.0! |"); @@ -129,9 +165,12 @@ fn main() { // Partitioning the selected drive format_drive(drive_name); + // placeholder for nix-generate-config + // Download nix files grab_flake(); grab_config(); grab_home(); + nix_gen(); } From 6efe2ba259fecb66a7f6f62a3728172b3c1f495e Mon Sep 17 00:00:00 2001 From: Aaron Honeycutt Date: Wed, 9 Apr 2025 20:30:35 -0600 Subject: [PATCH 04/12] add host selection menu --- src/main.rs | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/main.rs b/src/main.rs index 5a5319e..f2beb7d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -173,4 +173,31 @@ fn main() { grab_home(); nix_gen(); + + // Host selection + loop { + println!(""); + println!("Host selection"); + println!("1. Device 1"); + println!("2. Device 2"); + println!("3. Device 3"); + println!(""); + + println!("Enter your host for installation:"); + + let mut choice = String::new(); + io::stdin().read_line(&mut choice).unwrap(); + + match choice.trim() { + "1" => println!("Hello, world!"), + "2" => { + println!("2 + 2 = {}", 2 + 2); + }, + "3" => { + println!("Goodbye!"); + break; + }, + _ => println!("Invalid choice, try again."), + } + } } From 8b16d6c481bcb95b59ae05247692d07dea84f78c Mon Sep 17 00:00:00 2001 From: Aaron Honeycutt Date: Wed, 9 Apr 2025 20:31:54 -0600 Subject: [PATCH 05/12] clean up incorrect code --- src/main.rs | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/src/main.rs b/src/main.rs index f2beb7d..284b544 100644 --- a/src/main.rs +++ b/src/main.rs @@ -120,15 +120,6 @@ fn grab_home() { } } -fn nix_gen() { - let output = Command::new("nixos-generate-config") - .arg("no-file-systems") - .arg("--root") - .arg("/mnt") - .output() - .expect("Failed to execute command"); -} - fn main() { println!("--------------------------------------"); println!("| Welcome to the Nyxi Installer 2.0! |"); @@ -160,8 +151,6 @@ fn main() { let drive_name = drive_name.trim(); - // let deposit_number: f64 = deposit_amount.parse().expect("Input not an integer"); - // Partitioning the selected drive format_drive(drive_name); @@ -172,7 +161,12 @@ fn main() { grab_config(); grab_home(); - nix_gen(); + let output = Command::new("nixos-generate-config") + .arg("no-file-systems") + .arg("--root") + .arg("/mnt") + .output() + .expect("Failed to execute command"); // Host selection loop { From e47764618a233f7cbf7c401250c1d3398eccc639 Mon Sep 17 00:00:00 2001 From: Aaron Honeycutt Date: Wed, 9 Apr 2025 20:42:49 -0600 Subject: [PATCH 06/12] 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); }, From df9d271f4257b4ebbfd8930705d3621718b5226c Mon Sep 17 00:00:00 2001 From: Aaron Honeycutt Date: Wed, 9 Apr 2025 20:50:45 -0600 Subject: [PATCH 07/12] correct flash drive size --- src/main.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main.rs b/src/main.rs index b80f143..65084d7 100644 --- a/src/main.rs +++ b/src/main.rs @@ -34,8 +34,7 @@ fn format_drive(drive_name: &str) -> rsfdisk::Result<()> { let root = Partition::builder() .partition_type(partition_type) .name("Root") - // 132,120,576 sectors for a 64GB flash drive - .size_in_sectors(132_120_576) + .size_in_sectors(121_634_816) // 500GB //.size_in_sectors(499_033_071_61) .build()?; @@ -138,7 +137,7 @@ fn main() { grab_config(); grab_home(); - let output = Command::new("nixos-generate-config") + let nixos_gen_con = Command::new("nixos-generate-config") .arg("no-file-systems") .arg("--root") .arg("/mnt") @@ -151,7 +150,7 @@ fn main() { println!("Host selection"); println!("1. Lemur Pro 13 (Garrus)"); println!("2. Device 2"); - println!("3. Device 3"); + println!("3. Quit"); println!(""); println!("Enter your host for installation:"); From 4121a00eea9eb450a7da6d3836581c6bdc021cd9 Mon Sep 17 00:00:00 2001 From: Aaron Honeycutt Date: Wed, 9 Apr 2025 20:53:19 -0600 Subject: [PATCH 08/12] add code for nixos-install (untested) --- src/main.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 65084d7..d165520 100644 --- a/src/main.rs +++ b/src/main.rs @@ -137,7 +137,7 @@ fn main() { grab_config(); grab_home(); - let nixos_gen_con = Command::new("nixos-generate-config") + let nixos-gen-config = Command::new("nixos-generate-config") .arg("no-file-systems") .arg("--root") .arg("/mnt") @@ -176,7 +176,10 @@ fn main() { break } "2" => { - println!("2 + 2 = {}", 2 + 2); + let nixos-install = Command::new("nixos-install") + .arg("--flake") + .arg("/mnt/etc/nixos#garrus") + .expect("Fiale to execute command"); }, "3" => { println!("Goodbye!"); From 7d472cee71a0141988aad8b4b70840f51bc2426a Mon Sep 17 00:00:00 2001 From: Aaron Honeycutt Date: Wed, 9 Apr 2025 20:54:48 -0600 Subject: [PATCH 09/12] add nix crate --- Cargo.lock | 19 +++++++++++++++++++ Cargo.toml | 1 + 2 files changed, 20 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index 4453c35..5a5e4e6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -70,6 +70,12 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "cfg_aliases" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" + [[package]] name = "clang-sys" version = "1.8.1" @@ -294,6 +300,18 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" +[[package]] +name = "nix" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46" +dependencies = [ + "bitflags", + "cfg-if", + "cfg_aliases", + "libc", +] + [[package]] name = "nom" version = "7.1.3" @@ -330,6 +348,7 @@ name = "nyxi-installer" version = "2.0.0" dependencies = [ "curl", + "nix", "rsfdisk", "sys_metrics", ] diff --git a/Cargo.toml b/Cargo.toml index f5d8dd9..05bc2ba 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,5 +5,6 @@ edition = "2021" [dependencies] curl = "0.4.47" +nix = "0.29.0" rsfdisk = "0.1.0" sys_metrics = "0.2.7" From ea97e91116caec0576f810d7e70cd41ed2012573 Mon Sep 17 00:00:00 2001 From: Aaron Honeycutt Date: Wed, 9 Apr 2025 21:08:33 -0600 Subject: [PATCH 10/12] fix names --- src/main.rs | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index d165520..a00d85f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -130,14 +130,28 @@ fn main() { // Partitioning the selected drive format_drive(drive_name); - // placeholder for nix-generate-config + // Formatting the partitions + let efi_partition = Command::new("mkfs.fat") + .arg("-F32") + .arg("-n") + .arg("EFI") + .arg("/dev/sda1") + .output() + .expect("Failed to partition boot partition as FAT32"); + + let root_partition = Command::new("mkfs.btrfs") + .arg("-L") + .arg("root") + .arg("/dev/sda1") + .output() + .expect("Failed to partition root partition as BTRFS"); // Download nix files grab_flake(); grab_config(); grab_home(); - let nixos-gen-config = Command::new("nixos-generate-config") + let nixos_gen_config = Command::new("nixos-generate-config") .arg("no-file-systems") .arg("--root") .arg("/mnt") @@ -176,9 +190,10 @@ fn main() { break } "2" => { - let nixos-install = Command::new("nixos-install") + let nixos_install = Command::new("nixos-install") .arg("--flake") .arg("/mnt/etc/nixos#garrus") + .output() .expect("Fiale to execute command"); }, "3" => { From 2679312b9f9cbce110d4179e8c4d90eb88f0c9c9 Mon Sep 17 00:00:00 2001 From: Aaron Honeycutt Date: Wed, 9 Apr 2025 21:13:42 -0600 Subject: [PATCH 11/12] partitioning is working --- shell.nix | 3 ++- src/main.rs | 8 +++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/shell.nix b/shell.nix index f3174fb..389b07c 100644 --- a/shell.nix +++ b/shell.nix @@ -12,7 +12,8 @@ llvmPackages.libclang llvmPackages.clang - # System + # Systemi + e2fsprogs openssl pkg-config util-linux diff --git a/src/main.rs b/src/main.rs index a00d85f..9f4970d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -139,12 +139,10 @@ fn main() { .output() .expect("Failed to partition boot partition as FAT32"); - let root_partition = Command::new("mkfs.btrfs") - .arg("-L") - .arg("root") - .arg("/dev/sda1") + let root_partition = Command::new("mkfs.ext4") + .arg("/dev/sda2") .output() - .expect("Failed to partition root partition as BTRFS"); + .expect("Failed to partition root partition as ext4"); // Download nix files grab_flake(); From 0c4f154325d045919d3cee33abe8226b12a0ec15 Mon Sep 17 00:00:00 2001 From: Aaron Honeycutt Date: Wed, 9 Apr 2025 21:14:25 -0600 Subject: [PATCH 12/12] add btrfs support to shell --- shell.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/shell.nix b/shell.nix index 389b07c..7f9e443 100644 --- a/shell.nix +++ b/shell.nix @@ -12,7 +12,8 @@ llvmPackages.libclang llvmPackages.clang - # Systemi + # System + btrfs-progs e2fsprogs openssl pkg-config