-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-hls.sh.nix
25 lines (22 loc) · 813 Bytes
/
build-hls.sh.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
{ pkgs ? (import ./nix/pkgs.nix).pkgs
, hls-version ? "2.4.0.0"
, exe-dir-expression ? "$(pwd)/hls"
}:
let nix = pkgs.nixVersions.nix_2_14;
coreutils = pkgs.coreutils;
realpath = "${coreutils}/bin/realpath";
in
pkgs.writeScriptBin "build-hls.sh" ''
#! /usr/bin/env nix-shell
#! nix-shell -i bash -p bash -p git -p cabal-install -p haskell.compiler.ghc90 -p zlib
set -e
EXE_DIR="${exe-dir-expression}"
cd "$(mktemp -d)"
git clone https://github.com/haskell/haskell-language-server.git
cd haskell-language-server
git checkout ${hls-version}
cabal build exe:haskell-language-server
cabal install --installdir "$EXE_DIR" exe:haskell-language-server
echo "Built haskell-language-server v${hls-version}"
echo "Executables installed in $(realpath $EXE_DIR)"
''