From 92a1b02e0236353c5685fdb13743a8a4f161d9e9 Mon Sep 17 00:00:00 2001 From: Aaron Honeycutt Date: Fri, 11 Apr 2025 06:14:32 -0600 Subject: [PATCH] remove funny messages and now boot mounts? --- src/main.rs | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/src/main.rs b/src/main.rs index fe3ba6f..029f4e5 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,6 +1,5 @@ use std::io; use std::io::Write; -use std::fs; use std::fs::File; use std::process::Command; use std::path::Path; @@ -10,7 +9,6 @@ use rsfdisk::core::partition_table::PartitionTableKind; use rsfdisk::core::partition::{Guid, Partition, PartitionKind}; use nix::mount::{mount, MsFlags}; -use std::os::unix::ffi::OsStrExt; use curl::easy::Easy; fn format_drive(drive_name: &str) -> rsfdisk::Result<()> { @@ -213,7 +211,7 @@ fn main() { // Mounting the partitions mount_root(); - // mount_boot(); + mount_boot(); // Download nix files grab_flake(); @@ -227,12 +225,14 @@ fn main() { .output() .expect("Failed to execute command"); - println!(""); - println!("-------------------------"); - println!("Water packed!"); - println!("Treats packed!"); - println!("We're ready for our walk!"); - println!("-------------------------"); + // Copies the nix files to /mnt/etc/nixos/ + let _nix_copy = Command::new("cp") + .arg("flake.nix") + .arg("configuration.nix") + .arg("home.nix") + .arg("/mnt/etc/nixos") + .output() + .expect("Failed to copy nix files over"); // Host selection loop { @@ -266,12 +266,21 @@ fn main() { transfer.perform().unwrap(); } - let _nixos_install = Command::new("nixos-install") + // Copies the system nix files to /mnt/etc/nixos/ + let _nix_copy = Command::new("cp") + .arg("garrus.nix") + .arg("/mnt/etc/nixos") + .output() + .expect("Failed to copy nix files over"); + + let nixos_install = Command::new("nixos-install") .arg("--flake") .arg("/mnt/etc/nixos#garrus") .output() .expect("Failed to execute command"); + println!("stdout:\n{}", String::from_utf8_lossy(&nixos_install.stdout)); + break } "2" => {