nix-tree
and various nix-store -q
commands seem to work but only for packages that you were successfully able to build. nix why-depends
doesn’t seem to work for packages that are marked broken on your platform. Here’s an example:
> NIXPKGS_ALLOW_BROKEN=1 nix why-depends --all nixpkgs#mkvtoolnix nixpkgs#compiler-rt
error: Package ‘compiler-rt-5.0.2’ in /nix/store/ra71v2rndffy7h06kgvaid0ccck0fjhg-source/pkgs/development/compilers/llvm/5/compiler-rt/default.nix:92 is marked as broken, refusing to evaluate.
a) To temporarily allow broken packages, you can use an environment variable
for a single invocation of the nix tools.
$ export NIXPKGS_ALLOW_BROKEN=1
b) For `nixos-rebuild` you can set
{ nixpkgs.config.allowBroken = true; }
in configuration.nix to override this.
c) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
{ allowBroken = true; }
to ~/.config/nixpkgs/config.nix.
(use '--show-trace' to show detailed location information)
I tried adding allowBroken = true; into my /etc/nix/nix.conf as well as to .config/nixpkgs/config.nix as this command suggests, but they didn’t seem to have any effect.
A separate question: how do you override dependencies? I tried the following in an overlay but they don’t seem to have any effect:
llvmPackage_5.compiler-rt = pkgs.llvmPackages_13.compiler-rt;
llvmPackage_5 = pkgs.llvmPackages_13;