mirror of
https://github.com/daylinmorgan/oizys.git
synced 2024-12-22 14:20:44 -06:00
actually use pixos-rebuild unless asked otherwise
This commit is contained in:
parent
a7625a12fe
commit
c27b4dde70
1 changed files with 10 additions and 2 deletions
|
@ -83,6 +83,9 @@ impl Oizys {
|
||||||
(if self.no_pinix { "nix" } else { "pix" }).to_string()
|
(if self.no_pinix { "nix" } else { "pix" }).to_string()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn nixos_rebuild_cmd(self: &Oizys) -> String {
|
||||||
|
self.nix() + "os-rebuild"
|
||||||
|
}
|
||||||
fn show_cmd(self: &Oizys, cmd: &Command) {
|
fn show_cmd(self: &Oizys, cmd: &Command) {
|
||||||
println!("executing: {}", format!("{:?}", cmd).replace('"', ""));
|
println!("executing: {}", format!("{:?}", cmd).replace('"', ""));
|
||||||
}
|
}
|
||||||
|
@ -105,8 +108,13 @@ impl Oizys {
|
||||||
|
|
||||||
fn nixos_rebuild(self: &Oizys, subcommand: &str) {
|
fn nixos_rebuild(self: &Oizys, subcommand: &str) {
|
||||||
let flake_output = format!("{}#{}", self.flake.to_string_lossy(), self.host);
|
let flake_output = format!("{}#{}", self.flake.to_string_lossy(), self.host);
|
||||||
let mut cmd = Command::new("nixos-rebuild");
|
let mut cmd = Command::new("sudo");
|
||||||
cmd.arg(subcommand).arg(flake_output);
|
cmd.args([
|
||||||
|
&self.nixos_rebuild_cmd(),
|
||||||
|
subcommand,
|
||||||
|
"--flake",
|
||||||
|
&flake_output,
|
||||||
|
]);
|
||||||
if self.verbose >= 2 {
|
if self.verbose >= 2 {
|
||||||
self.show_cmd(&cmd);
|
self.show_cmd(&cmd);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue