eval: remove is_test and embed mock-nixpkgs.nix #86
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
Similar to #84, reducing the amount of needed machinery in Nix in favor of Rust code. In particular, remove
NIX_PATH
manipulation in Nix derivations!Things Done
This commit does the following things:
nix-instantiate
. Opt in to the five environment variables needed in order to runnix-instantiate
in the Nix sandbox.NIX_PATH
environment variables indefault.nix
andpackage.nix
. These were implicitly sent through tonix-instantiate
, along with-I
arguments. Now, only-I
is used.is_test
argument with#[cfg(test)]
applied tomutate_nix_instatiate_arguments_based_on_cfg
.While this is slightly more lines of code that the combination of Nix and Rust that it replaces, there is less Nix logic and more Rust logic.
Additionally, the Rust logic that is test-only is contained to
cargo check
only rather than being present in the production binary.