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:
DottoDev
2022-10-10 18:03:34 +00:00
committed by GitHub
parent a5e0128e1b
commit 5dffa2c6cc
3 changed files with 21 additions and 0 deletions

View File

@@ -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")?;