diff --git a/pkgs/applications/misc/gnuradio/default.nix b/pkgs/applications/misc/gnuradio/default.nix index 29409a2e6f24..41466fa6fc02 100644 --- a/pkgs/applications/misc/gnuradio/default.nix +++ b/pkgs/applications/misc/gnuradio/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, makeWrapper +{ stdenv, fetchurl, writeText, makeWrapper # Dependencies documented @ https://gnuradio.org/doc/doxygen/build_guide.html # => core dependencies , cmake, pkgconfig, git, boost, cppunit, fftw @@ -55,6 +55,16 @@ stdenv.mkDerivation rec { --replace BOOST_CONSTEXPR_OR_CONST const ''; + # Enables composition with nix-shell + grcSetupHook = writeText "grcSetupHook.sh" '' + addGRCBlocksPath() { + addToSearchPath GRC_BLOCKS_PATH $1/share/gnuradio/grc/blocks + } + envHooks+=(addGRCBlocksPath) + ''; + + setupHook = [ grcSetupHook ]; + preConfigure = '' export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -Wno-unused-variable -std=c++11" '';