-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshell.nix
More file actions
44 lines (44 loc) · 1.21 KB
/
shell.nix
File metadata and controls
44 lines (44 loc) · 1.21 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
{ nixpkgs ? import <nixpkgs> { }, ghcVersion ? "984" }:
let
isWSL = if builtins.pathExists /etc/wsl.conf then true else false;
inherit (nixpkgs) pkgs;
# "ghc${ghcVersion} needs to macth Stackage LTS versionm
# from stack.yaml snapshot
ghc = pkgs.haskell.packages."ghc${ghcVersion}".ghcWithPackages (ps:
with ps;
(if isWSL then
[ ]
else [
# libraries
xmonad
xmonad-utils
xmonad-extras
xmonad-contrib
xmobar
hint
# "tools"
# haskell-language-server # This must match the GHC version in order to work
implicit-hie
ghcid
]));
in pkgs.stdenv.mkDerivation {
name = "NixOS development environment";
nativeBuildInputs = with pkgs;
[ gnumake ] ++ (if !isWSL then [
# Only include ghc if we will develop XMonad on actual NixOS
ghc
(haskell-language-server.override {
supportedGhcVersions = [ "${ghcVersion}" ];
})
cabal-install # https://github.com/NixOS/nixpkgs/issues/321569
] else
[ ]);
shellHook = # bash
''
eval $(egrep ^export ${ghc}/bin/ghc)
# cabal v2-update
cd modules/home/xmonad/
gen-hie > hie.yaml
'';
# env = { FLAKE = builtins.getEnv "PWD"; };
}