add function to setup timeshift ( #4 )

axtloss/rework-partitioning
amy 3 years ago
parent cdea166eb4
commit 079d9ad2e3

@ -19,8 +19,6 @@ pub fn install_base_packages() {
"archlinux-keyring",
"neofetch",
"btrfs-progs",
"timeshift",
"timeshift-autosnap",
"which",
]);
}
@ -77,3 +75,11 @@ pub fn install_bootloader_legacy(device: &str) {
"create grub.cfg",
);
}
pub fn setup_timeshift() {
install(vec!["timeshift", "timeshift-autosnap"]);
exec_eval(
exec_chroot("timeshift", vec![String::from("--btrfs")]),
"setup timeshift",
)
}

@ -140,8 +140,11 @@ pub fn choose_pkgs(desktop_setup: &str) {
}
install(vec!["networkmanager"]);
exec_eval(
exec_chroot("systemctl", vec![String::from("enable"), String::from("NetworkManager")]),
"Enable network manager"
exec_chroot(
"systemctl",
vec![String::from("enable"), String::from("NetworkManager")],
),
"Enable network manager",
);
}

@ -30,10 +30,7 @@ pub fn set_locale(locale: String) {
"add locales to locale.gen",
);
}
exec_eval(
exec_chroot("locale-gen", vec![]),
"generate locales",
);
exec_eval(exec_chroot("locale-gen", vec![]), "generate locales");
files::create_file("/mnt/etc/locale.conf");
files_eval(
files::append_file("/mnt/etc/locale.conf", "LANG=en_US.UTF-8"),

@ -38,6 +38,10 @@ fn main() {
SubCommand::with_name("genfstab")
.about("Generate fstab")
)
.subcommand(
SubCommand::with_name("setup-timeshift")
.about("Setup timeshift")
)
.subcommand(
SubCommand::with_name("bootloader")
.about("Install bootloader")
@ -154,7 +158,12 @@ fn main() {
} else if let Some(app) = app.subcommand_matches("locale") {
let kbrlayout = app.value_of("keyboard").unwrap();
let timezn = app.value_of("timezone").unwrap();
locale::set_locale(app.values_of("locales").unwrap().collect::<Vec<&str>>().join(" "));
locale::set_locale(
app.values_of("locales")
.unwrap()
.collect::<Vec<&str>>()
.join(" "),
);
locale::set_keyboard(kbrlayout);
locale::set_timezone(timezn);
} else if let Some(app) = app.subcommand_matches("networking") {
@ -187,6 +196,8 @@ fn main() {
base::install_base_packages();
} else if app.subcommand_matches("genfstab").is_some() {
base::genfstab();
} else if app.subcommand_matches("setup-timeshift").is_some() {
base::setup_timeshift();
} else {
println!("Running TUI installer");
}

Loading…
Cancel
Save