diff --git a/Cargo.lock b/Cargo.lock index d9826a8..ce43728 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -722,7 +722,7 @@ dependencies = [ [[package]] name = "nh" -version = "3.5.14" +version = "3.5.15" dependencies = [ "ambassador", "anstyle", diff --git a/Cargo.toml b/Cargo.toml index 426ce4c..905c446 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "nh" -version = "3.5.14" +version = "3.5.15" edition = "2021" license = "EUPL-1.2" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/src/home.rs b/src/home.rs index 2f18356..18331c8 100644 --- a/src/home.rs +++ b/src/home.rs @@ -114,7 +114,8 @@ impl HomeRebuildArgs { // just do nothing for None case (fresh installs) if let Some(prev_gen) = prev_generation { commands::CommandBuilder::default() - .args(["nvd", "diff", (prev_gen.to_str().unwrap()), out_link_str]) + .args(self.common.diff_provider.split_ascii_whitespace()) + .args([(prev_gen.to_str().unwrap()), out_link_str]) .message("Comparing changes") .build()? .exec()?; diff --git a/src/interface.rs b/src/interface.rs index fe3a9e7..8f8b03f 100644 --- a/src/interface.rs +++ b/src/interface.rs @@ -135,6 +135,17 @@ pub struct CommonRebuildArgs { /// Don't use nix-output-monitor for the build process #[arg(long)] pub no_nom: bool, + + /// Closure diff provider + /// + /// Default is "nvd diff", but "nix store diff-closures" is also supported + #[arg( + long, + short = 'D', + env = "NH_DIFF_PROVIDER", + default_value = "nvd diff" + )] + pub diff_provider: String, } #[derive(Args, Debug)] diff --git a/src/nixos.rs b/src/nixos.rs index 6c8269f..246c1d1 100644 --- a/src/nixos.rs +++ b/src/nixos.rs @@ -103,9 +103,8 @@ impl OsRebuildArgs { target_profile.try_exists().context("Doesn't exist")?; commands::CommandBuilder::default() + .args(self.common.diff_provider.split_ascii_whitespace()) .args([ - "nvd", - "diff", CURRENT_PROFILE, target_profile.to_str().unwrap(), ])