How can I find out what causes the broken lua5.1-magick-1.6.0-1 dependency?

Recently I find broken lua5.1-magick-1.6.0-1 in my build.

┃ error:
┃        … while calling the 'head' builtin
┃          at /nix/store/sb52h1fv08hn654rn06x2zmrf3wqylbs-source/lib/attrsets.nix:960:11:
┃           959|         || pred here (elemAt values 1) (head values) then
┃           960|           head values
┃              |           ^
┃           961|         else
┃        … while evaluating the attribute 'value'
┃          at /nix/store/sb52h1fv08hn654rn06x2zmrf3wqylbs-source/lib/modules.nix:809:9:
┃           808|     in warnDeprecation opt //
┃           809|       { value = builtins.addErrorContext "while evaluating the option `${showOption loc}':" value;
┃              |         ^
┃           810|         inherit (res.defsFinal') highestPrio;
┃        (stack trace truncated; use '--show-trace' to show the full trace)
┃        error: Package ‘lua5.1-magick-1.6.0-1’ in /nix/store/sb52h1fv08hn654rn06x2zmrf3wqylbs-source/pkgs/development/lua-modules/generated-packages.nix:2621 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
┃           Note: When using `nix shell`, `nix build`, `nix develop`, etc with a flake,
┃                 then pass `--impure` in order to allow use of environment variables.
┃        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.

How can I find out what causes this dependency?
There is nix why-depends, but I can’t figure out how to use it with flakes.

My config is at

I had championed a PR that would have meta.broken explains why it is broken.
In this case, lua5_1.pkgs.magick is marked broken (and I was we would do it differently) because magick is available only for luajit: it needs the FFI for C integration. See magick - LuaRocks

1 Like

Thanks for the explanation.
I’m not quite sure how I added that dependency to my system. Probably some of my neovim stuff that I might not need.
I would like to try to get rid of the dependency instead of building with NIXPKGS_ALLOW_BROKEN=1

What does it say if you add --show-trace?

1 Like

Interestingly it was apparently just fixed upstream. I did a flake update for something else and now it works fine.

1 Like