I am trying to add nRF Command Line Tools to nixpkgs.
It is almost successful, except for one dependency: Segger Jlink
There is an open pull request for this package, so I copied the defualt.nix file from it and added it to my own fork of nixpkgs.
This Jlink install seems to work fine on its own, as I can run commands from it from a terminal.
I am able to install the nRF Command Line tools. However, when I try to run one of the two programs installed, nrfjprog, it crashes due it not being able to run JLink.
I have tried to add the JLink package to runtimeDependencies in the default.nix.
To fix this temporary, I can add the path of the JLink binaries to LD_LIBRARY_PATH
$ export LD_LIBRARY_PATH=$(nix-build -A jlink)/bin:$LD_LIBRARY_PATH
How can I do the same in the default.nix?