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", ":"); } diff --git a/tests/impure/devenv.nix b/tests/impure/devenv.nix index 9e9a2091a..db06ca451 100644 --- a/tests/impure/devenv.nix +++ b/tests/impure/devenv.nix @@ -2,4 +2,7 @@ enterTest = '' echo ${builtins.currentSystem}; ''; + + # Test procfile evaluation with --impure + processes.hello.exec = "echo hello"; }