I’ve come across a behavior in Nix I don’t understand (not the first time, but this one can’t figure out): say I have a pkgs.mkShell
derivation assigned to devShell
with buildInputs
defined as a list with 7 elements, two of which are pkgs.lld_15
and pkgs.llvm_15
. I want to define pkgs.writeShellApplication
and reuse buildInputs
from devShell
as runtimeInputs
. However, it turns out that pkgs.lld_15
and pkgs.llvm_15
are not passed and to have them available in pkgs.writeShellApplication
I need to add them explicitly: runtimeInputs = devShell.buildInputs ++ [ pkgs.lld_15 pkgs.llvm_15 ];
. Why?
IMO the behavior indicates, that they are somehow filtered out and when used in runtimeInputs
definition they are not present in devShell.buildInputs
list. In my understanding, in this scenario, buildInputs
is just an ordinary attribute and is not processed in any way. Then what happens with these two derivations?