made EXPR_PATH point to local instead of store

- we need this behavior in dev shell
- the main build still uses the store file
This commit is contained in:
Hariom Narang 2023-11-21 01:11:06 +05:30
parent 437b2054f4
commit ca97497bfd
2 changed files with 5 additions and 4 deletions

View file

@ -8,7 +8,7 @@
makeWrapper,
}:
let
runtimeExprPath = "${./src/eval.nix}";
runtimeExprPath = ./src/eval.nix;
package =
rustPlatform.buildRustPackage {
name = "nixpkgs-check-by-name";
@ -20,7 +20,7 @@ let
clippy
makeWrapper
];
env.NIX_CHECK_BY_NAME_EXPR_PATH = runtimeExprPath;
env.NIX_CHECK_BY_NAME_EXPR_PATH = "${runtimeExprPath}";
# Needed to make Nix evaluation work inside the nix build
preCheck = ''
export TEST_ROOT=$(pwd)/test-tmp
@ -43,7 +43,7 @@ let
--set NIX_CHECK_BY_NAME_EXPR_PATH "$NIX_CHECK_BY_NAME_EXPR_PATH"
'';
passthru.shell = mkShell {
env.NIX_CHECK_BY_NAME_EXPR_PATH = runtimeExprPath;
env.NIX_CHECK_BY_NAME_EXPR_PATH = toString runtimeExprPath;
inputsFrom = [ package ];
};
};

View file

@ -58,7 +58,8 @@ pub fn check_values(
attrs_file_path.display()
))?;
let expr_path = std::env::var("NIX_CHECK_BY_NAME_EXPR_PATH")?;
let expr_path = std::env::var("NIX_CHECK_BY_NAME_EXPR_PATH")
.context("Could not get environment variable NIX_CHECK_BY_NAME_EXPR_PATH")?;
// With restrict-eval, only paths in NIX_PATH can be accessed, so we explicitly specify the
// ones needed needed
let mut command = process::Command::new("nix-instantiate");