remove funny messages and now boot mounts?

This commit is contained in:
Aaron Honeycutt 2025-04-11 06:14:32 -06:00
parent 24febde5f7
commit 92a1b02e02

View file

@ -1,6 +1,5 @@
use std::io; use std::io;
use std::io::Write; use std::io::Write;
use std::fs;
use std::fs::File; use std::fs::File;
use std::process::Command; use std::process::Command;
use std::path::Path; use std::path::Path;
@ -10,7 +9,6 @@ use rsfdisk::core::partition_table::PartitionTableKind;
use rsfdisk::core::partition::{Guid, Partition, PartitionKind}; use rsfdisk::core::partition::{Guid, Partition, PartitionKind};
use nix::mount::{mount, MsFlags}; use nix::mount::{mount, MsFlags};
use std::os::unix::ffi::OsStrExt;
use curl::easy::Easy; use curl::easy::Easy;
fn format_drive(drive_name: &str) -> rsfdisk::Result<()> { fn format_drive(drive_name: &str) -> rsfdisk::Result<()> {
@ -213,7 +211,7 @@ fn main() {
// Mounting the partitions // Mounting the partitions
mount_root(); mount_root();
// mount_boot(); mount_boot();
// Download nix files // Download nix files
grab_flake(); grab_flake();
@ -227,12 +225,14 @@ fn main() {
.output() .output()
.expect("Failed to execute command"); .expect("Failed to execute command");
println!(""); // Copies the nix files to /mnt/etc/nixos/
println!("-------------------------"); let _nix_copy = Command::new("cp")
println!("Water packed!"); .arg("flake.nix")
println!("Treats packed!"); .arg("configuration.nix")
println!("We're ready for our walk!"); .arg("home.nix")
println!("-------------------------"); .arg("/mnt/etc/nixos")
.output()
.expect("Failed to copy nix files over");
// Host selection // Host selection
loop { loop {
@ -266,12 +266,21 @@ fn main() {
transfer.perform().unwrap(); 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("--flake")
.arg("/mnt/etc/nixos#garrus") .arg("/mnt/etc/nixos#garrus")
.output() .output()
.expect("Failed to execute command"); .expect("Failed to execute command");
println!("stdout:\n{}", String::from_utf8_lossy(&nixos_install.stdout));
break break
} }
"2" => { "2" => {