Configuring withHoogle in default.nix:

Viewed 488

I'm trying to setup withHoogle in my default.nix, but I'm getting this error:

developPackage, error: attempt to call something which is not a function but a set(at line 26).

Here is my default.nix code:

let
  pkgs = import <nixpkgs> {};
  compilerVersion = "ghc865"; 
  compiler = pkgs.haskell.packages."${compilerVersion}";
in
compiler.developPackage
  {
    # returnShellEnv = false;

    root = ./.;

    # source-overrides = {};

        modifier = drv:
          let pkg = pkgs.haskell.lib.addBuildTools drv (with  pkgs.haskellPackages;
        [
         cabal-install
         cabal2nix
         ghcid

         control
         text
         brick
        ]);
      in pkg // {
       env = (pkg.env { withHoogle = true; }).overrideAttrs (old: {
          shellHook =
          ''
            export PS1='\n\[\033[1;32m\][\[\e]0;nix-shell: \W\a\]nix-shell:/\W]\$ \[\033[0m\]'
          '';
    });
  };
}
1 Answers

I had a similar error message when trying to nix-build a seemingly correct derivation (default.nix). Eventually I found out using the --show-trace parameter to nix-build, that the error lie in an overlay I had in my user's ~/.config/nixpkgs/overlays directory lying around. HTH

Related