From 473ccb631dee27929eb5e3ec4928a6a0a59768ac Mon Sep 17 00:00:00 2001 From: Trolli Schmittlauch Date: Sun, 26 Jul 2020 16:26:26 +0200 Subject: [PATCH 1/2] add hie as language server to dev environment --- default.nix | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/default.nix b/default.nix index eea5386..5bf5a15 100644 --- a/default.nix +++ b/default.nix @@ -1,14 +1,26 @@ -{ pkgs ? import ( - builtins.fetchGit { - name = "nixpkgs-pinned"; - url = https://github.com/NixOS/nixpkgs/; - ref = "refs/heads/release-20.03"; - rev = "da7ddd822e32aeebea00e97ab5aeca9758250a40"; - }) {}, +{ compiler ? "ghc865" }: let + # pin all-hies for getting the language server + all-hies = fetchTarball { + url = "https://github.com/infinisil/all-hies/tarball/b8fb659620b99b4a393922abaa03a1695e2ca64d"; + sha256 = "sha256:0br6wsqpfk1lzz90f7zw439w1ir2p54268qilw9l2pk6yz7ganfx"; + }; + pkgs = import ( + builtins.fetchGit { + name = "nixpkgs-pinned"; + url = https://github.com/NixOS/nixpkgs/; + ref = "refs/heads/release-20.03"; + rev = "076c67fdea6d0529a568c7d0e0a72e6bc161ecf5"; + }) { + # Pass no config for purity + config = {}; + overlays = [ + (import all-hies {}).overlay + ]; + }; hp = pkgs.haskell.packages."${compiler}"; src = pkgs.nix-gitignore.gitignoreSource [] ./.; drv = hp.callCabal2nix "Hash2Pub" "${src}/Hash2Pub.cabal" {}; @@ -25,6 +37,7 @@ in hlint stylish-haskell pkgs.python3Packages.asn1ate + hie ]; }; } From 6349e05033d593d8eed4556e46365110f95859ef Mon Sep 17 00:00:00 2001 From: Trolli Schmittlauch Date: Sun, 26 Jul 2020 16:38:56 +0200 Subject: [PATCH 2/2] enable HIE only in the shell environment, but not by default --- default.nix | 7 ++++--- shell.nix | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/default.nix b/default.nix index 5bf5a15..4e77a05 100644 --- a/default.nix +++ b/default.nix @@ -1,5 +1,6 @@ { - compiler ? "ghc865" + compiler ? "ghc865", + withHIE ? false }: let @@ -37,7 +38,7 @@ in hlint stylish-haskell pkgs.python3Packages.asn1ate - hie - ]; + ] + ++ (if withHIE then [ hie ] else []); }; } diff --git a/shell.nix b/shell.nix index 82fb296..dafd212 100644 --- a/shell.nix +++ b/shell.nix @@ -1 +1 @@ -(import ./default.nix {}).shell +(import ./default.nix {withHIE = true;}).shell