From bdcb457450a574632519af6aae6112a0c48e8dad Mon Sep 17 00:00:00 2001 From: Sander Date: Wed, 3 Apr 2024 08:15:02 +0000 Subject: [PATCH] Fix devenv up with the impure option Only pass the `--impure` option to the modern nix command that supports it. --- devenv/src/command.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/devenv/src/command.rs b/devenv/src/command.rs index 15fdccc7a..3d9a0a18d 100644 --- a/devenv/src/command.rs +++ b/devenv/src/command.rs @@ -140,7 +140,11 @@ impl App { }; if self.cli.impure || self.config.impure { - flags.push("--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" { + flags.push("--impure"); + } // set a dummy value to overcome https://github.com/NixOS/nix/issues/10247 cmd.env("NIX_PATH", ":"); }