-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdefault.nix
More file actions
51 lines (41 loc) · 1.33 KB
/
default.nix
File metadata and controls
51 lines (41 loc) · 1.33 KB
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
46
47
48
49
50
51
{}:
let
commonEnvs = builtins.fetchGit {
url = "https://github.com/avanov/nix-common.git";
ref = "master";
rev = "9d81a5757aa0dfb7ca68edccd081bdf591c6df9e";
};
ghcEnv = import "${commonEnvs}/ghc-env.nix" {};
pkgs = ghcEnv.pkgs;
macOsDeps = with pkgs; lib.optionals stdenv.isDarwin [
darwin.apple_sdk.frameworks.CoreServices
darwin.apple_sdk.frameworks.ApplicationServices
];
devEnv = pkgs.mkShell {
# Sets the build inputs, i.e. what will be available in our
# local environment.
nativeBuildInputs = with pkgs; [
cabal-install
cabal2nix
cachix
cacert
glibcLocales
gnumake
gitAndTools.pre-commit
haskell-language-server
ghc
zlib
] ++ macOsDeps;
shellHook = ''
export PROJECT_PLATFORM="${builtins.currentSystem}"
export LANG=en_GB.UTF-8
# https://cabal.readthedocs.io/en/3.4/installing-packages.html#environment-variables
export CABAL_DIR=$PWD/.local/${builtins.currentSystem}/cabal
# symbolic link to Language Server to satisfy VSCode Haskell plugins
ln -s -f `which haskell-language-server` $PWD/hls.exe
'';
};
in
{
inherit devEnv;
}