aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMat Marini <mat@marini.ca>2020-07-29 20:50:06 -0400
committerMat Marini <mat@marini.ca>2020-07-29 20:50:06 -0400
commite4f6f8da77f8de0f19e81f1cbb60052ca92dd371 (patch)
tree8071e06fac36d4394993b551f323dae3aa0887ed
parentf63839bfa402f73e001a5ee412c3f6a6b95d1a38 (diff)
Prevent nix-build from accepting --packages
-rwxr-xr-xsrc/nix-build/nix-build.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nix-build/nix-build.cc b/src/nix-build/nix-build.cc
index f77de56ea..d8f2fe6d7 100755
--- a/src/nix-build/nix-build.cc
+++ b/src/nix-build/nix-build.cc
@@ -192,7 +192,7 @@ static void _main(int argc, char * * argv)
else if (*arg == "--pure") pure = true;
else if (*arg == "--impure") pure = false;
- else if (*arg == "--packages" || *arg == "-p")
+ else if (runEnv && (*arg == "--packages" || *arg == "-p"))
packages = true;
else if (inShebang && *arg == "-i") {