lorri icon indicating copy to clipboard operation
lorri copied to clipboard

how to setup lorri to work with ghc.nix

Open zeta-00 opened this issue 5 years ago • 5 comments

hello there, i'm having a hard time setting up lorri to work with my ghc.nix setup, if you could help me out, thanks in advance:

https://www.reddit.com/r/haskell/comments/htoxcg/help_setting_up_ghcnix_with_lorri/

zeta-00 avatar Jul 25 '20 19:07 zeta-00

there's probably a simple way to do this, but i'm new to lorri, so i'm not sure how to do this setup?

zeta-00 avatar Jul 25 '20 19:07 zeta-00

i renamed ghc.nix's default.nix file to ghc.nix, i then used callPackage to call in the shell.nix file that's generated by lorri init. there was no errors and running nix-shell works, but for some reason the tools in the ghc.nix file do not seem to be installed, running ghcid and ghcide returns: command not found by terminal?

anyways here's the ghc.nix(renamed from default.nix) file:

https://github.com/alpmestan/ghc.nix/blob/master/default.nix

and here's the shell.nix file generated by lorri init, that uses callPackage to call on the ghc.nix file:

{ pkgs ? import {} }: with pkgs;

mkShell {

ghc = callPackage ./ghc.nix {};

buildInputs =
  [
    ghc
    
    bashInteractive
  ];

shellHook =
  ''
     export EDITOR=emacs;

     export HIE_HOOGLE_DATABASE="$(cat $(which hoogle) | sed -n -e 's|.*--database \\(.*\\.hoo\\).*|\\1|p')";
     export NIX_GHC="$(which ghc)";
     export NIX_GHCPKG="$(which ghc-pkg)";
     export NIX_GHC_DOCDIR="$NIX_GHC/../../share/doc/ghc/html";
     export NIX_GHC_LIBDIR="$(ghc --print-libdir)";
  '';

}

zeta-00 avatar Jul 26 '20 02:07 zeta-00

@Profpatsch , do you have any tips, on how to fix this?

zeta-00 avatar Jul 26 '20 02:07 zeta-00

nix-shell is throwing the error: which: no hoogle in (PATH /nix/store/...) ?

zeta-00 avatar Jul 26 '20 02:07 zeta-00

It sounds like some part of the toolchain is calling which to find hoogle, you might try to add it to the shell file.

On Sun, Jul 26, 2020 at 4:56 AM zeta [email protected] wrote:

nix-shell is throwing the error: which: no hoogle in (PATH /nix/store/...) ?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/target/lorri/issues/452#issuecomment-663928990, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAYB5ZR6OMRO3ZJIWNACV7TR5OLMBANCNFSM4PHTM3NQ .

Profpatsch avatar Jul 28 '20 19:07 Profpatsch