I’ve been diving into source code to understand how mkShell handles each dependency type. I’ve stumbled upon mergeInputs and it stunned me a little. If I understand it correctly it returns a list of all the dependencies of that specified type (i.e. buildInputs
, nativeBuildInputs
) that aren’t listed in inputsFrom
.
From what I see, apart from mergeInputs
, inputsFrom
wasn’t called anywhere else. Question: Does this mean that any dependency that I specified in inputsFrom
wouldn’t get called if it is a dependency of another dependency in inputsFrom
For example
in shell.nix
let
pkgs = import <nixpkgs> {};
b = pkgs.stdenv.mkDerivation {
pname = "b";
version = "0.0.0";
src = /some-code/that-needs/a/in-it;
buildInputs = [ a ];
};
in
pkgs.mkShell {
inputsFrom = [ a b ];
}
when I run nix-shell and call a, it wouldn’t be there ?
what if I have another package c in inputsFrom
that has runtime dependency on a, How do I manage to create a shell that can do that?
or if I understand anything wrong, PLEASE, feel free to correct me.
Cheers!!