Skip to content

Commit

Permalink
add --no-specialisation
Browse files Browse the repository at this point in the history
closes #39
  • Loading branch information
viperML committed Oct 17, 2023
1 parent e9d099f commit 303c4ff
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "nh"
version = "3.4.8"
version = "3.4.9"
edition = "2021"
license = "EUPL-1.2"

Expand Down
4 changes: 4 additions & 0 deletions src/interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ pub struct OsRebuildArgs {
#[arg(long, short)]
pub specialisation: Option<String>,

/// Don't use specialisations
#[arg(long, short = 'S')]
pub no_specialisation: bool,

/// Extra arguments passed to nix build
#[arg(last = true)]
pub extra_args: Vec<String>,
Expand Down
7 changes: 5 additions & 2 deletions src/nixos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,11 @@ impl OsRebuildArgs {

let current_specialisation = std::fs::read_to_string(SPEC_LOCATION).ok();

let target_specialisation =
current_specialisation.or_else(|| self.specialisation.to_owned());
let target_specialisation = if self.no_specialisation {
None
} else {
current_specialisation.or_else(|| self.specialisation.to_owned())
};

debug!("target_specialisation: {target_specialisation:?}");

Expand Down

0 comments on commit 303c4ff

Please sign in to comment.