-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
54 lines (48 loc) · 1.84 KB
/
flake.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
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
52
53
54
{
description = "Hagit";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
overlays = [ ];
pkgs = import nixpkgs { inherit system overlays; };
hPkgs = pkgs.haskell.packages."ghc946";
myDevTools = [
hPkgs.ghc # GHC compiler in the desired version (will be available on PATH)
hPkgs.ghcid # Continuous terminal Haskell compile checker
hPkgs.ormolu # Haskell formatter
hPkgs.hlint # Haskell codestyle checker
hPkgs.hoogle # Lookup Haskell documentation
hPkgs.haskell-language-server # LSP server for editor
# hPkgs.implicit-hie # auto generate LSP hie.yaml file from cabal
# hPkgs.retrie # Haskell refactoring tool
# hPkgs.cabal-install
stack-wrapped
pkgs.zlib # External C library needed by some Haskell packages
];
stack-wrapped = pkgs.symlinkJoin {
name = "stack";
paths = [ pkgs.stack ];
buildInputs = [ pkgs.makeWrapper ];
postBuild = ''
wrapProgram $out/bin/stack \
--add-flags "\
--no-nix \
--system-ghc \
--no-install-ghc \
"
'';
};
in with pkgs; {
devShell = mkShell {
buildInputs = myDevTools;
# Make external Nix c libraries like zlib known to GHC, like
# pkgs.haskell.lib.buildStackProject does
# https://github.com/NixOS/nixpkgs/blob/d64780ea0e22b5f61cd6012a456869c702a72f20/pkgs/development/haskell-modules/generic-stack-builder.nix#L38
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath myDevTools;
};
});
}