Skip to content

Commit

Permalink
Fix dev tools not exposed
Browse files Browse the repository at this point in the history
lazyDerivation ended up filtering out .nativeBuildInputs and co.,
which mkShell's inputsFrom relies on to figure out what to use for the environment..
  • Loading branch information
infinisil committed Apr 18, 2024
1 parent 6090c42 commit be2948f
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -45,26 +45,27 @@ let
settings.formatter.shfmt.options = [ "--space-redirects" ];
};

buildUnfiltered = pkgs.callPackage ./package.nix {
inherit
nixpkgsLibPath
initNix
runtimeExprPath
testNixpkgsPath
version
;
};

results = {
# We're using this value as the root result. By default, derivations expose all of their
# internal attributes, which is very messy. We prevent this using lib.lazyDerivation
build = lib.lazyDerivation {
derivation = pkgs.callPackage ./package.nix {
inherit
nixpkgsLibPath
initNix
runtimeExprPath
testNixpkgsPath
version
;
};
};
build = lib.lazyDerivation { derivation = buildUnfiltered; };

shell = pkgs.mkShell {
env.NIX_CHECK_BY_NAME_EXPR_PATH = toString runtimeExprPath;
env.NIX_PATH = "test-nixpkgs=${toString testNixpkgsPath}:test-nixpkgs/lib=${toString nixpkgsLibPath}";
env.RUST_SRC_PATH = "${pkgs.rustPlatform.rustLibSrc}";
inputsFrom = [ results.build ];
# inputsFrom relies on .nativeBuildInputs and co. to exist, which are filtered out by lazyDerivation
inputsFrom = [ buildUnfiltered ];
nativeBuildInputs = with pkgs; [
npins
rust-analyzer
Expand Down

0 comments on commit be2948f

Please sign in to comment.