Add flatpak option support

axtloss/rework-partitioning
axtlos 3 years ago
parent b9baec39c0
commit 1b05b6d203
No known key found for this signature in database
GPG Key ID: A468AFD71DD51D4A

@ -56,6 +56,10 @@ pub enum Command {
#[clap(name = "nix")] #[clap(name = "nix")]
Nix, Nix,
/// Install flatpak and enable flathub
#[clap(name = "flatpak")]
Flatpak,
/// Read jade installation config /// Read jade installation config
#[clap(name = "config")] #[clap(name = "config")]
Config { Config {

@ -118,3 +118,10 @@ pub fn setup_timeshift() {
pub fn install_homemgr() { pub fn install_homemgr() {
install(vec!["nix"]); install(vec!["nix"]);
} }
pub fn install_flatpak() {
install(vec!["flatpak"]);
exec_eval(
exec_chroot("flatpak", vec![String::from("remote-add"), String::from("--if-not-exists"), String::from("flathub"), String::from("https://flathub.org/repo/flathub.flatpakrepo")]),
)
}

@ -14,7 +14,6 @@ pub fn install_desktop_setup(desktop_setup: DesktopSetup) {
DesktopSetup::Xfce => install_xfce(), DesktopSetup::Xfce => install_xfce(),
DesktopSetup::Enlightenment => install_enlightenment(), DesktopSetup::Enlightenment => install_enlightenment(),
DesktopSetup::None => log::debug!("No desktop setup selected"), DesktopSetup::None => log::debug!("No desktop setup selected"),
_ => crash("Unsupported desktop setup", 1),
} }
install_networkmanager(); install_networkmanager();
} }

@ -15,6 +15,7 @@ struct Config {
rootpass: String, rootpass: String,
desktop: Option<DesktopSetup>, desktop: Option<DesktopSetup>,
timeshift: bool, timeshift: bool,
flatpak: bool,
extra_packages: Vec<String>, extra_packages: Vec<String>,
} }
@ -144,6 +145,11 @@ pub fn read_config(configpath: PathBuf) {
if config.timeshift { if config.timeshift {
base::setup_timeshift(); base::setup_timeshift();
} }
println!();
log::info!("Enabling flatpak : {}", config.flatpak);
if config.flatpak {
base::setup_flatpak();
}
log::info!("Extra packages : {:?}", config.extra_packages); log::info!("Extra packages : {:?}", config.extra_packages);
let mut extra_packages: Vec<&str> = Vec::new(); let mut extra_packages: Vec<&str> = Vec::new();
for i in 0..config.extra_packages.len() { for i in 0..config.extra_packages.len() {

@ -55,6 +55,9 @@ fn main() {
}, },
Command::Nix => { Command::Nix => {
base::install_homemgr(); base::install_homemgr();
},
Command::Flatpak => {
base::install_flatpak();
} }
Command::Config { config } => { Command::Config { config } => {
crate::internal::config::read_config(config); crate::internal::config::read_config(config);

Loading…
Cancel
Save