From 11e7d3ef56f542e70f138069fe9b95401c2143c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Domen=20Ko=C5=BEar?= Date: Fri, 19 Apr 2024 08:26:15 +0100 Subject: [PATCH] #1145: don't propagate --impure to gc --- devenv/src/command.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/devenv/src/command.rs b/devenv/src/command.rs index e58fc353e..f042f2bc0 100644 --- a/devenv/src/command.rs +++ b/devenv/src/command.rs @@ -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