Skip to content

Commit 0659c83

Browse files
committed
ci: Do not pass --accept-flake-config by default
NixOS/nix#9649
1 parent 0f9a4b1 commit 0659c83

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

crates/nix_rs/src/flake/command.rs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ pub struct FlakeOptions {
119119
pub refresh: bool,
120120

121121
/// Accept `nixConfig` configuration in flake.nix
122-
pub accept_flake_config: bool,
122+
pub accept_flake_config: Option<bool>,
123123

124124
/// The directory from which to run our nix command (such that relative flake URLs resolve properly)
125125
pub current_dir: Option<PathBuf>,
@@ -131,7 +131,8 @@ impl Default for FlakeOptions {
131131
override_inputs: BTreeMap::new(),
132132
no_write_lock_file: false,
133133
refresh: false,
134-
accept_flake_config: true, // --accept-flake-config is the default
134+
// Do not enable this by default since it is not secure; https://github.com/NixOS/nix/issues/9649
135+
accept_flake_config: None,
135136
current_dir: None,
136137
}
137138
}
@@ -152,8 +153,12 @@ impl FlakeOptions {
152153
if self.refresh {
153154
cmd.arg("--refresh");
154155
}
155-
if self.accept_flake_config {
156-
cmd.arg("--accept-flake-config");
156+
if let Some(accept) = self.accept_flake_config {
157+
if accept {
158+
cmd.arg("--accept-flake-config");
159+
} else {
160+
cmd.arg("--no-accept-flake-config");
161+
}
157162
}
158163
}
159164
}

0 commit comments

Comments
 (0)