From be2948f7d6c844e08f9cb9cb6255cc9e0ea7514a Mon Sep 17 00:00:00 2001 From: Silvan Mosberger Date: Thu, 18 Apr 2024 18:52:32 +0200 Subject: [PATCH] Fix dev tools not exposed lazyDerivation ended up filtering out .nativeBuildInputs and co., which mkShell's inputsFrom relies on to figure out what to use for the environment.. --- default.nix | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/default.nix b/default.nix index d381e7b..8b737a4 100644 --- a/default.nix +++ b/default.nix @@ -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