From 33298ebf1d0ced006b163d4af593d53cac0c9bf9 Mon Sep 17 00:00:00 2001 From: axtloss Date: Sun, 21 Aug 2022 10:31:49 +0000 Subject: [PATCH] Add zramd option --- src/args.rs | 4 ++++ src/functions/base.rs | 11 +++++++++++ src/functions/desktops.rs | 4 ++-- src/main.rs | 3 +++ 4 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/args.rs b/src/args.rs index 0f42b06..7a57073 100644 --- a/src/args.rs +++ b/src/args.rs @@ -45,6 +45,10 @@ pub enum Command { #[clap(name = "networking")] Networking(NetworkingArgs), + /// Set up zram + #[clap(name = "zram")] + Zram, + /// Configure users and passwords #[clap(name = "users")] Users { diff --git a/src/functions/base.rs b/src/functions/base.rs index da8c4fd..729b303 100755 --- a/src/functions/base.rs +++ b/src/functions/base.rs @@ -166,3 +166,14 @@ pub fn install_flatpak() { "add flathub remote", ) } + +pub fn install_zram() { + install(vec!["zram"]); + exec_eval( + exec_chroot( + "systemctl", + vec![String::from("enable"), String::from("zramd")], + ), + "Enable zramd service", + ); +} diff --git a/src/functions/desktops.rs b/src/functions/desktops.rs index cdeb4ed..9d11f00 100755 --- a/src/functions/desktops.rs +++ b/src/functions/desktops.rs @@ -287,7 +287,7 @@ fn install_gnome() { enable_dm("gdm"); } -fn install_onyx() { +/*fn install_onyx() { install(vec![ "xorg", "onyx", @@ -304,7 +304,7 @@ fn install_onyx() { "Add lightdm greeter", ); enable_dm("lightdm"); -} +}*/ fn enable_dm(dm: &str) { log::debug!("Enabling {}", dm); diff --git a/src/main.rs b/src/main.rs index 3925e73..5236803 100755 --- a/src/main.rs +++ b/src/main.rs @@ -51,6 +51,9 @@ fn main() { } network::set_hostname(&args.hostname); } + Command::Zram => { + base::install_zram(); + } Command::Users { subcommand } => match subcommand { UsersSubcommand::NewUser(args) => { users::new_user(