diff --git a/pkgs/test/nixpkgs-check-by-name/default.nix b/pkgs/test/nixpkgs-check-by-name/default.nix index 3469319c29c1..fc24b1fd3398 100644 --- a/pkgs/test/nixpkgs-check-by-name/default.nix +++ b/pkgs/test/nixpkgs-check-by-name/default.nix @@ -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 ]; }; }; diff --git a/pkgs/test/nixpkgs-check-by-name/src/eval.rs b/pkgs/test/nixpkgs-check-by-name/src/eval.rs index e8ef50bb6db7..161d013374e7 100644 --- a/pkgs/test/nixpkgs-check-by-name/src/eval.rs +++ b/pkgs/test/nixpkgs-check-by-name/src/eval.rs @@ -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");