Add new step: GNU Guix by JamesClarke7283 (#1)
* Added new step: guix (basic support) * Fixed clippy errors and better practice, Thanks To guidence from @enchant97 <Leo Spratt> * Removed accidental swp file, as pointed out by @strangelittlemonkey in pull request #982 Authored-by: James Clarke <james@james-clarke.ynh.fr> Approved-by: Thomas Schönauer <t.schoenauer@hgs-wt.at>
This commit is contained in:
@@ -94,6 +94,7 @@ pub enum Step {
|
||||
GithubCliExtensions,
|
||||
GitRepos,
|
||||
Go,
|
||||
Guix,
|
||||
Haxelib,
|
||||
GnomeShellExtensions,
|
||||
HomeManager,
|
||||
|
||||
@@ -191,6 +191,8 @@ fn run() -> Result<()> {
|
||||
{
|
||||
runner.execute(Step::Yadm, "yadm", || unix::run_yadm(&ctx))?;
|
||||
runner.execute(Step::Nix, "nix", || unix::run_nix(&ctx))?;
|
||||
runner.execute(Step::Guix, "guix", || unix::run_guix(&ctx))?;
|
||||
|
||||
runner.execute(Step::HomeManager, "home-manager", || unix::run_home_manager(run_type))?;
|
||||
runner.execute(Step::Asdf, "asdf", || unix::run_asdf(run_type))?;
|
||||
runner.execute(Step::Pkgin, "pkgin", || unix::run_pkgin(&ctx))?;
|
||||
|
||||
@@ -251,6 +251,24 @@ pub fn run_brew_cask(ctx: &ExecutionContext, variant: BrewVariant) -> Result<()>
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn run_guix(ctx: &ExecutionContext) -> Result<()> {
|
||||
let guix = require("guix")?;
|
||||
|
||||
let run_type = ctx.run_type();
|
||||
|
||||
let output = Command::new(&guix).arg("pull").check_output();
|
||||
debug!("guix pull output: {:?}", output);
|
||||
let should_upgrade = output.is_ok();
|
||||
debug!("Can Upgrade Guix: {:?}", should_upgrade);
|
||||
|
||||
print_separator("Guix");
|
||||
|
||||
if should_upgrade {
|
||||
return run_type.execute(&guix).args(&["package", "-u"]).check_run();
|
||||
}
|
||||
Err(SkipStep(String::from("Guix Pull Failed, Skipping")).into())
|
||||
}
|
||||
|
||||
pub fn run_nix(ctx: &ExecutionContext) -> Result<()> {
|
||||
let nix = require("nix")?;
|
||||
let nix_channel = require("nix-channel")?;
|
||||
|
||||
Reference in New Issue
Block a user