Haskell-language-server support for xmonad

I’m trying to get IDE support for my xmonad.hs using haskell-language-server. Here’s my configuration.nix:

windowManager = {
  xmonad = {
    enable = true;
    enableContribAndExtras = true;
    extraPackages = haskellPackages: [
      haskellPackages.dbus
      haskellPackages.List
      haskellPackages.monad-logger
      haskellPackages.xmonad
    ];
  };
};

The language server plugin on my IDE understandably had problems in recognizing imports: Could not find module ‘XMonad...’.. So I tried to provide it an hie.yaml

cradle:
  bios:
    program: "./hie-bios.sh"
    with-ghc: "/nix/store/waa0dlvlszwbplrz5c7j674ab6v1n5wi-ghc-8.8.4-with-packages/bin/ghc"

Where hie-bios.sh is echo "xmonad" >> $HIE_BIOS_OUTPUT (I don’t understand what this does though). I derived the with-ghc path by looking at GHC command in the xmonad path in the store.

I’m sure there’s a better/simpler way to do this without hardcoding paths like this. Suggestions?