-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshell.nix
More file actions
44 lines (38 loc) · 720 Bytes
/
Copy pathshell.nix
File metadata and controls
44 lines (38 loc) · 720 Bytes
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
{ lib
, haskellPackages
, mkShell
, zsh
}:
let
name = "haskell-env";
ghcWithEnv = haskellPackages.ghcWithPackages (ps:
lib.pipe (import ./.) [
lib.functionArgs
builtins.attrNames
(lib.subtractLists [ "base" "mkDerivation" ])
(lib.intersectLists (builtins.attrNames ps))
(map (n: ps.${n}))
]
++ builtins.attrValues {
inherit
(ps)
cabal-install
haskell-language-server
hpack
implicit-hie
ormolu
;
});
in
mkShell {
inherit name;
packages = [
ghcWithEnv
];
shellHook = ''
export NIX_SHELL_NAME="${name}"
eval $(egrep ^export ${ghcWithEnv}/bin/ghc)
${zsh}/bin/zsh
exit 0
'';
}