Skip to content

Commit

Permalink
no_channel_add -> add_channel
Browse files Browse the repository at this point in the history
  • Loading branch information
mkenigs committed Feb 19, 2024
1 parent 35293c5 commit 0cc6693
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
6 changes: 3 additions & 3 deletions src/action/common/configure_nix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,14 @@ impl ConfigureNix {
.await
.map_err(Self::error)?;

let setup_channels = if settings.no_channel_add {
None
} else {
let setup_channels = if settings.add_channel {
Some(
SetupChannels::plan(PathBuf::from(SCRATCH_DIR))
.await
.map_err(Self::error)?,
)
} else {
None
};

Ok(Self {
Expand Down
19 changes: 10 additions & 9 deletions src/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -250,13 +250,14 @@ pub struct CommonSettings {
#[cfg_attr(
feature = "cli",
clap(
long,
default_value = "false",
env = "NIX_INSTALLER_NO_CHANNEL_ADD",
global = true
action(ArgAction::SetFalse),
default_value = "true",
global = true,
env = "NIX_INSTALLER_ADD_CHANNEL",
long("no-add-channel"),
)
)]
pub no_channel_add: bool,
pub add_channel: bool,
}

impl CommonSettings {
Expand Down Expand Up @@ -329,7 +330,7 @@ impl CommonSettings {
diagnostic_attribution: None,
#[cfg(feature = "diagnostics")]
diagnostic_endpoint: Some("https://install.determinate.systems/nix/diagnostic".into()),
no_channel_add: false,
add_channel: false,
})
}

Expand All @@ -351,7 +352,7 @@ impl CommonSettings {
diagnostic_attribution: _,
#[cfg(feature = "diagnostics")]
diagnostic_endpoint,
no_channel_add,
add_channel,
} = self;
let mut map = HashMap::default();

Expand Down Expand Up @@ -395,8 +396,8 @@ impl CommonSettings {
);

map.insert(
"no_channel_add".into(),
serde_json::to_value(no_channel_add)?,
"add_channel".into(),
serde_json::to_value(add_channel)?,
);

Ok(map)
Expand Down

0 comments on commit 0cc6693

Please sign in to comment.