Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zeta-00/acbe3dd19fa1400eb03a473750483fa2 to your computer and use it in GitHub Desktop.
Save zeta-00/acbe3dd19fa1400eb03a473750483fa2 to your computer and use it in GitHub Desktop.
Hello guys, I installed ghcide which is working great, but everytime that I do a rebuild I have to run: cat $(which ghc),
then set the newly generated nix path of NIX_GHC_LIBDIR in the in it's corresponding sessionVariable of my
home.nix configuration, is there a way to automate this process so I don't have to keep doing this manually
over and over again?
here is an issue that someone else is having that is similar to my issue:
https://github.com/hercules-ci/ghcide-nix/issues/26
also, here is my sessionVariables code section of my home.nix configuration file:
sessionVariables = {
EDITOR = "emacs";
HIE_HOOGLE_DATABASE = "$(cat $(which hoogle) | sed -n -e 's|.*--database \\(.*\\.hoo\\).*|\\1|p')";
NIX_GHC_LIBDIR = "/nix/store/mc4nx9v5fbz5dwd0kabfpxkzjd5zaz8c-ghc-8.6.5-with-packages/lib/ghc-8.6.5";
};
@zeta-00
Copy link
Author

zeta-00 commented Jan 24, 2020

here are are the commands that i have tried to set NIX_GHC_LIBDIR to:

NIX_GHC_LIBDIR="${pkgs.ghc}/lib/ghc-${pkgs.ghc.version}"

${pkgs.ghc}/lib/ghc-*

NIX_GHC_LIBDIR="${pkgs.ghc.outPath}/lib/ghc-${pkgs.ghc.version}";

@zeta-00
Copy link
Author

zeta-00 commented Jan 24, 2020

here is my home.nix file configuration: https://hastebin.com/ohenivaway.bash

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment