diff --git a/Cargo.lock b/Cargo.lock index 165bd3f..ef13355 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -43,20 +43,19 @@ dependencies = [ [[package]] name = "anstyle-wincon" -version = "3.0.7" +version = "3.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca3534e77181a9cc07539ad51f2141fe32f6c3ffd4df76db8ad92346b003ae4e" +checksum = "2109dbce0e72be3ec00bed26e6a7479ca384ad226efdd66db8fa2e3a38c83125" dependencies = [ "anstyle", - "once_cell", "windows-sys", ] [[package]] name = "bitflags" -version = "2.9.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c8214115b7bf84099f1309324e63141d4c5d7cc26862f97a0a857dbefe165bd" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" [[package]] name = "cfg-if" @@ -72,18 +71,18 @@ checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" [[package]] name = "clap" -version = "4.5.32" +version = "4.5.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6088f3ae8c3608d19260cd7445411865a485688711b78b5be70d78cd96136f83" +checksum = "3135e7ec2ef7b10c6ed8950f0f792ed96ee093fa088608f1c76e569722700c84" dependencies = [ "clap_builder", ] [[package]] name = "clap_builder" -version = "4.5.32" +version = "4.5.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22a7ef7f676155edfb82daa97f99441f3ebf4a58d5e32f295a56259f1b6facc8" +checksum = "30582fc632330df2bd26877bde0c1f4470d57c582bbc070376afcd04d8cb4838" dependencies = [ "anstream", "anstyle", @@ -105,9 +104,9 @@ checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990" [[package]] name = "equivalent" -version = "1.0.2" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "hashbrown" @@ -117,9 +116,9 @@ checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" [[package]] name = "indexmap" -version = "2.8.0" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3954d50fe15b02142bf25d3b8bdadb634ec3948f103d04ffe3031bc8fe9d7058" +checksum = "62f822373a4fe84d4bb149bf54e584a7f4abec90e072ed49cda0edea5b95471f" dependencies = [ "equivalent", "hashbrown", @@ -133,15 +132,15 @@ checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" [[package]] name = "itoa" -version = "1.0.15" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" +checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" [[package]] name = "libc" -version = "0.2.171" +version = "0.2.169" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c19937216e9d3aa9956d9bb8dfc0b0c8beb6058fc4f7a4dc4d850edf86a237d6" +checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" [[package]] name = "memchr" @@ -173,50 +172,44 @@ dependencies = [ "libc", ] -[[package]] -name = "once_cell" -version = "1.21.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d75b0bedcc4fe52caa0e03d9f1151a323e4aa5e2d78ba3580400cd3c9e2bc4bc" - [[package]] name = "proc-macro2" -version = "1.0.94" +version = "1.0.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a31971752e70b8b2686d7e46ec17fb38dad4051d94024c88df49b667caea9c84" +checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.40" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" dependencies = [ "proc-macro2", ] [[package]] name = "ryu" -version = "1.0.20" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "serde" -version = "1.0.219" +version = "1.0.216" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" +checksum = "0b9781016e935a97e8beecf0c933758c97a5520d32930e460142b4cd80c6338e" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.219" +version = "1.0.216" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" +checksum = "46f859dbbf73865c6627ed570e78961cd3ac92407a2d117204c49232485da55e" dependencies = [ "proc-macro2", "quote", @@ -225,9 +218,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.140" +version = "1.0.135" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" +checksum = "2b0d7ba2887406110130a978386c4e1befb98c674b4fba677954e4db976630d9" dependencies = [ "itoa", "memchr", @@ -252,9 +245,9 @@ checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "syn" -version = "2.0.100" +version = "2.0.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b09a44accad81e1ba1cd74a32461ba89dee89095ba17b32f5d03683b1b1fc2a0" +checksum = "d53cbcb5a243bd33b7858b1d7f4aca2153490815872d86d955d6ea29f743c035" dependencies = [ "proc-macro2", "quote", @@ -263,9 +256,9 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.20" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd87a5cdd6ffab733b2f74bc4fd7ee5fff6634124999ac278c35fc78c6120148" +checksum = "a1ed1f98e3fdc28d6d910e6737ae6ab1a93bf1985935a1193e68f93eeb68d24e" dependencies = [ "serde", "serde_spanned", @@ -284,9 +277,9 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.22.24" +version = "0.22.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17b4795ff5edd201c7cd6dca065ae59972ce77d1b80fa0a84d94950ece7d1474" +checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" dependencies = [ "indexmap", "serde", @@ -297,9 +290,9 @@ dependencies = [ [[package]] name = "unicode-ident" -version = "1.0.18" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" +checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" [[package]] name = "utf8parse" @@ -382,9 +375,9 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" -version = "0.7.4" +version = "0.6.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e97b544156e9bebe1a0ffbc03484fc1ffe3100cbce3ffb17eac35f7cdd7ab36" +checksum = "36c1fec1a2bb5866f07c25f68c26e565c4c200aebb96d7e55710c19d3e8ac49b" dependencies = [ "memchr", ] diff --git a/src/args.rs b/src/args.rs index b61c4a2..34b51ca 100644 --- a/src/args.rs +++ b/src/args.rs @@ -7,7 +7,6 @@ pub fn get_args() -> clap::ArgMatches { command!("create-iso") .about("Create a new installation medium ISO") .arg(arg!(--without_gui "Create ISO with just terminal")) - .arg(arg!(--no_tmp "Create ISO on disk")) .arg(arg!(--kb_layout "Create ISO with this keyboard layout")) .arg(arg!(--kb_variant "Create ISO with this keyboard layout variant")) .arg(arg!(--install "Create ISO which automatically installs upon boot.")) diff --git a/src/create_iso.rs b/src/create_iso.rs index 894542f..14dd5b2 100644 --- a/src/create_iso.rs +++ b/src/create_iso.rs @@ -15,7 +15,6 @@ pub fn build_kxkbrc(layout: &str, variant: Option<&str>) -> String { pub fn create_iso( without_gui: bool, - no_tmp: bool, kb_layout: &str, kb_variant: Option<&str>, install: Option<&String>, @@ -60,10 +59,9 @@ pub fn create_iso( std::fs::create_dir_all("./work").unwrap(); - if !no_tmp { - let mount_cmd = vec!["mount", "-t", "tmpfs", "-o", "size=10G", "tmpfs", "./work"]; - run_command(&mount_cmd, None, false); - } + let mount_cmd = vec!["mount", "-t", "tmpfs", "-o", "size=10G", "tmpfs", "./work"]; + + run_command(&mount_cmd, None, false); let mkarchiso_cmd = vec!["mkarchiso", "-v", "-w", "./work", "-o", "./", "./iso"]; diff --git a/src/install/gpu.rs b/src/install/gpu.rs index 7ed6460..9532dda 100644 --- a/src/install/gpu.rs +++ b/src/install/gpu.rs @@ -17,7 +17,7 @@ pub fn setup_video_drivers(vendor: &GPUVendor) { } GPUVendor::INTEL => { install_pkgs(&[ - "xf86-video-intel", + "xf86-video-intel2", "mesa", "lib32-mesa", "vulkan-intel", diff --git a/src/install/mod.rs b/src/install/mod.rs index 58a8650..b30de83 100644 --- a/src/install/mod.rs +++ b/src/install/mod.rs @@ -1,8 +1,5 @@ // TODO : Autojoin docker swarm // TODO : Autojoin teleport -// TODO : Install CA certs -// TODO : Install node exporter -// TODO : ZFS? // DRIVE SELECTION @@ -45,10 +42,6 @@ pub mod user; pub mod virt; pub mod zram; -// TODO : error handling -// TODO : Power profile daemon -// TODO : Make zsh default + completions - use crate::{ config::InstallConfig, pkg::{self, install_pkgs, pacstrap}, diff --git a/src/install/ollama.rs b/src/install/ollama.rs index 47ca27e..af5e79f 100644 --- a/src/install/ollama.rs +++ b/src/install/ollama.rs @@ -1,5 +1,3 @@ -use std::time::Duration; - use crate::{ config::OllamaConfig, linux::{arch_chroot, systemd_service_enable}, @@ -21,13 +19,11 @@ pub fn setup_ollama(conf: &OllamaConfig) { let mut ollama_server = std::process::Command::new("arch-chroot") .arg("/mnt") - .arg("/bin/runuser -u ollama -- env OLLAMA_MODELS=/var/lib/ollama HOME=/var/lib/ollama /usr/bin/ollama serve") + .arg("runuser -u ollama -- env OLLAMA_MODELS=/var/lib/ollama HOME=/var/lib/ollama /usr/bin/ollama serve") .stdout(std::process::Stdio::piped()) .spawn() .expect("Failed to start ollama server"); - std::thread::sleep(Duration::from_secs(5)); - let models = conf.models.clone().unwrap_or_default(); for model in models { diff --git a/src/install/security.rs b/src/install/security.rs index e063e78..33d525d 100644 --- a/src/install/security.rs +++ b/src/install/security.rs @@ -49,7 +49,8 @@ pub fn setup_tpm_unlock(conf: &DriveConfig) { // SECURE BOOT -pub fn ensure_secure_boot() { +/// Setup Secure Boot on the system +pub fn setup_secure_boot() { let (stdout, _) = run_command(&["sbctl", "status"], None, false); let binding = stdout.lines().collect::>(); let status = binding.get(1).unwrap(); @@ -61,11 +62,6 @@ pub fn ensure_secure_boot() { ); std::process::exit(1); } -} - -/// Setup Secure Boot on the system -pub fn setup_secure_boot() { - ensure_secure_boot(); install_pkgs(&["sbctl", "sbsigntools"]); diff --git a/src/install/virt.rs b/src/install/virt.rs index 584e96e..2f75a68 100644 --- a/src/install/virt.rs +++ b/src/install/virt.rs @@ -12,7 +12,7 @@ pub fn setup_virtualization(conf: &InstallConfig) { Vec::new() }; - install_pkgs(&["libvirt", "swtpm", "qemu-base"]); + install_pkgs(&["libvirt"]); if matches!(conf.general.mode, InstallMode::Desktop) { install_pkgs(&["virt-manager"]); @@ -34,7 +34,9 @@ pub fn setup_virtualization(conf: &InstallConfig) { /// Setup guest utils if running inside a VM pub fn setup_vm() { let res = run_command(&["systemd-detect-virt", "--vm"], None, false); - let is_vm = res.0.trim(); + let is_vm = res + .0 + .trim(); match is_vm { "qemu" | "kvm" => { diff --git a/src/main.rs b/src/main.rs index d3b44e2..986bd0e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -10,7 +10,7 @@ mod linux; mod pkg; mod print; use create_iso::create_iso; -use install::{install, security::ensure_secure_boot}; +use install::install; use linux::is_root; use print::print_config; use yansi::{Color, Paint}; @@ -35,20 +35,13 @@ fn main() { match args.subcommand() { Some(("create-iso", iso_args)) => { let without_gui = iso_args.get_flag("without_gui"); - let no_tmp = iso_args.get_flag("no_tmp"); let kb_layout_default = "us".to_string(); let kb_layout: &String = iso_args.get_one("kb_layout").unwrap_or(&kb_layout_default); let kb_variant: Option<&str> = iso_args.get_one("kb_variant").map(|x: &String| x.as_str()); let auto_install_config: Option<&String> = iso_args.get_one("install"); - create_iso( - without_gui, - no_tmp, - kb_layout, - kb_variant, - auto_install_config, - ); + create_iso(without_gui, kb_layout, kb_variant, auto_install_config); std::process::exit(0); } Some(("create-tar", _)) => { @@ -68,8 +61,6 @@ fn main() { std::process::exit(1); } - ensure_secure_boot(); - let config_file: &String = install_args.get_one("config").unwrap(); let force = install_args.get_flag("force"); let conf = read_conf(config_file);