Skip to content

Commit

Permalink
#1145: don't propagate --impure to gc
Browse files Browse the repository at this point in the history
  • Loading branch information
domenkozar committed Apr 19, 2024
1 parent 5541a7a commit 11e7d3e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion devenv/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,12 @@ impl App {
if self.cli.impure || self.config.impure {
// only pass the impure option to the nix command that supports it.
// avoid passing it to the older utilities, e.g. like `nix-store` when creating GC roots.
if command == "nix" {
if command == "nix"
&& args
.first()
.map(|arg| arg == &"build" || arg == &"eval" || arg == &"print-dev-env")
.unwrap_or(false)
{
flags.push("--impure");
}
// set a dummy value to overcome https://github.com/NixOS/nix/issues/10247
Expand Down

0 comments on commit 11e7d3e

Please sign in to comment.