How to set the ghcArgs with home-manager with xmonad?

Using the xsession.xmonad does not give good support for the ghcArgs configuration.

I see that it directly calls xmonad-with-packages, which in turn calls a wrapper.nix. I don’t know how to sanely configure that ghcArgs for this.

When I try to set xsession.windowManager.xmonad.ghcArgs, home-manager tells me that this config options does not exist.

Also, I’d like to know how to get all configurable options under, e.g. xsession.windowManager.xmonad.

Sometimes home-manager and NixOS both have a module for configuring the same thing.

I usually look in man configuration.nix and man home-configuration.nix for the NixOS and home-manager options respectively. But here are the same docs online:

You are correct that the ghcArgs option does not exist in the home-manager version of the xmonad module. In home-manager it uses xmonad --recompile whereas in NixOS it builds using ghc directly (well, via pkgs.writers.writeHaskellBin).

Which GHC options do you need to change? Perhaps an OPTIONS_GHC pragma could work?