Skip to content

Commit ffd5ced

Browse files
committed
Add better shell.nix
1 parent 9bd0928 commit ffd5ced

File tree

1 file changed

+5
-69
lines changed

1 file changed

+5
-69
lines changed

shell.nix

Lines changed: 5 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,5 @@
1-
# This shell.nix file is designed for use with cabal build
2-
# It does **not** aim to replace Cabal
3-
4-
# Maintaining this file:
5-
#
6-
# - Bump the nixpkgs version using `niv update nixpkgs`
7-
# - To edit the set of local packages:
8-
# 1. Declare them in nix/default.nix
9-
# 2. Edit the list of packages below
10-
#
11-
# For more details: https://github.com/NixOS/nixpkgs/blob/20.03/pkgs/development/haskell-modules/make-package-set.nix#L256
12-
13-
14-
{ compiler ? "default",
15-
withHoogle ? false,
16-
nixpkgs ? import ./nix {}
17-
}:
18-
19-
with nixpkgs;
20-
21-
let defaultCompiler = "ghc" + lib.replaceStrings ["."] [""] haskellPackages.ghc.version;
22-
haskellPackagesForProject =
23-
if compiler == "default"
24-
then ourHaskell.packages.${defaultCompiler}
25-
else ourHaskell.packages.${compiler};
26-
27-
packages = p: [ p.haskell-language-server
28-
p.ghcide
29-
p.shake-bench
30-
p.hie-compat
31-
p.hls-plugin-api
32-
p.hls-class-plugin
33-
p.hls-haddock-comments-plugin
34-
p.hls-eval-plugin
35-
p.hls-explicit-imports-plugin
36-
p.hls-hlint-plugin
37-
p.hls-retrie-plugin
38-
p.hls-splice-plugin
39-
p.hls-tactics-plugin
40-
];
41-
42-
isSupported = compiler == "default" || compiler == defaultCompiler;
43-
in
44-
haskellPackagesForProject.shellFor {
45-
inherit withHoogle;
46-
doBenchmark = true;
47-
packages = p: if isSupported then packages p else [p.ghc-paths];
48-
buildInputs = [
49-
gmp
50-
zlib
51-
ncurses
52-
capstone
53-
tracy
54-
55-
haskellPackages.cabal-install
56-
haskellPackages.hlint
57-
haskellPackages.ormolu
58-
haskellPackages.stylish-haskell
59-
haskellPackages.opentelemetry-extra
60-
61-
];
62-
src = null;
63-
shellHook = ''
64-
export LD_LIBRARY_PATH=${gmp}/lib:${zlib}/lib:${ncurses}/lib:${capstone}/lib
65-
export DYLD_LIBRARY_PATH=${gmp}/lib:${zlib}/lib:${ncurses}/lib:${capstone}/lib
66-
export PATH=$PATH:$HOME/.local/bin
67-
${pre-commit-check.shellHook}
68-
'';
69-
}
1+
with { pkgs = import <nixpkgs> {}; };
2+
pkgs.mkShell
3+
{ buildInputs = [ pkgs.haskell.compiler.ghc8102 pkgs.zlib pkgs.haskellPackages.cabal-install pkgs.git-lfs ];
4+
shellHook=''export LD_LIBRARY_PATH=${pkgs.gmp}/lib:${pkgs.zlib}/lib:${pkgs.ncurses}/lib'';
5+
}

0 commit comments

Comments
 (0)