This repository has been archived by the owner on Jan 7, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 22
/
default.nix
45 lines (41 loc) · 1.62 KB
/
default.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
{ sources ? import ./sources.nix
, haskellNix ? import sources."haskell.nix" {}
, nixpkgsSrc ? haskellNix.sources.nixpkgs-2003
, nixpkgsArgs ? haskellNix.nixpkgsArgs
, pkgs ? import nixpkgsSrc nixpkgsArgs
}:
let
mkPackages = { ghc, stackYaml }:
pkgs.haskell-nix.stackProject {
src = sources.ghcide;
inherit stackYaml;
modules = [({config, ...}: {
ghc.package = ghc;
compiler.version = pkgs.lib.mkForce ghc.version;
packages.ghc.flags.ghci = pkgs.lib.mkForce true;
packages.ghci.flags.ghci = pkgs.lib.mkForce true;
# This fixes a performance issue, probably https://gitlab.haskell.org/ghc/ghc/issues/15524
packages.ghcide.configureFlags = [ "--enable-executable-dynamic" ];
packages.ghcide.components.library.doHaddock = pkgs.lib.mkForce false;
})];
};
mkGhcide = args@{ ghc, stackYaml }:
let
packages = mkPackages args;
in packages.ghcide.components.exes.ghcide // { inherit packages; };
devTools = {
inherit (pkgs) niv;
};
in {
export = {
ghcide-ghc865 = mkGhcide { ghc = pkgs.haskell-nix.compiler.ghc865; stackYaml = "stack.yaml"; };
ghcide-ghc884 = mkGhcide { ghc = pkgs.haskell-nix.compiler.ghc884; stackYaml = "stack88.yaml"; };
ghcide-ghc8102 = mkGhcide { ghc = pkgs.haskell-nix.compiler.ghc8102; stackYaml = "stack810.yaml"; };
hie-bios = (mkPackages { ghc = pkgs.haskell-nix.compiler.ghc865; stackYaml = "stack.yaml"; }).hie-bios.components.exes.hie-bios;
inherit mkGhcide;
};
inherit devTools;
shell = pkgs.mkShell {
buildInputs = pkgs.lib.attrValues devTools;
};
}