enableDebugging in flake

I would like people to easily be able to report neovim stacktraces. To this end neovim’s flake has dedicated nvim-debug flake app. Sadly gdb complains

Reading symbols from /nix/store/c9wmikyx7lyj5bzn005qxflhl8kby5a4-neovim-unwrapped-master/bin/nvim...
(No debugging symbols found in /nix/store/c9wmikyx7lyj5bzn005qxflhl8kby5a4-neovim-unwrapped-master/bin/nvim

Thus I’ve tried to modify the flake to use pkgs.enableDebugging (you can test via
nix run 'github:teto/neovim/flake-fix?dir=contrib#nvim-debug' --no-write-lock-file)

This ends up with

error: --- Error ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ nix
output '/nix/store/kmadcxsrwqi4yqss7lip74qyskws6xw2-neovim-unwrapped-master' is not allowed to refer to the following paths:
  /nix/store/h1yd31nnd68pyb2d3dh6n713k0g0m9xp-clang-wrapper-11.0.1

any idea how to fix that ?

the relevant flake.nix file: https://github.com/teto/neovim/blob/8502b554c2d5ee53aef30eec7b074b290572a2c6/contrib/flake.nix#L30

1 Like

You might need to override disallowedReferences originating from the actual derivation: https://github.com/NixOS/nixpkgs/blob/62b753c3d7a8af7c2e00b274fd3dadd0bbdf71f2/pkgs/applications/editors/neovim/default.nix#L93

1 Like

thanks that was it. I’ve modified this file in the past but never noticed this line xD