Add flag `set-env-var` to `MixEnvironment`, and rename old ones
Motivation
Closes: #11495 Closes: #10338
Context
https://github.com/NixOS/nix/pull/11490#discussion_r1757055057
Ref: #11490
Priorities and Process
Add :+1: to pull requests you find important.
The Nix maintainer team uses a GitHub project board to schedule and track reviews.
I have another question following yours. What if the user does the following?
$ nix run --set-env-var FOO '' --unset-env-var FOO --set-env-var FOO '' ...
Since we're talking about storing it all in a map, the second appearance of --set-env-var FOO will just be ignored altogether, right?
I don't believe it'd be correct to add "weight" to certain flags, so they do survive something like this, maybe throw a warning to the user they've added a duplicate flag?
I gave the tests a go, let me know what you think.
Apparently, also fixes one more shellcheck case from #10795.
This pull request has been mentioned on NixOS Discourse. There might be relevant details there:
https://discourse.nixos.org/t/2024-09-30-nix-team-meeting-minutes-182/53814/1
This pull request has been mentioned on NixOS Discourse. There might be relevant details there:
https://discourse.nixos.org/t/2024-10-09-nix-team-meeting-minutes-185/54335/1
This pull request has been mentioned on NixOS Discourse. There might be relevant details there:
https://discourse.nixos.org/t/2024-11-04-nix-team-meeting-minutes-191/55846/1