-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
71 lines (67 loc) · 2.31 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
{
description = "Dev Setup";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
inputs.flake-utils.url = "github:numtide/flake-utils";
outputs = {nixpkgs, flake-utils, ...}:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
# Avoids unnecessary recompiles
filteredSource = pkgs.lib.cleanSourceWith {
src = ./.;
filter = path: type:
let baseName = baseNameOf (toString path);
in pkgs.lib.cleanSourceFilter path type && !(
baseName == "flake.nix" ||
baseName == "flake.lock" ||
baseName == "dist-newstyle" ||
builtins.match "^cabal\.project\..*$" baseName != null ||
baseName == "hls.sh" ||
baseName == ".envrc" ||
baseName == "hie.yaml" ||
baseName == ".hlint.yaml" ||
baseName == ".hspec" ||
baseName == "ci"
);
};
ghcOverrides = hself: hsuper: rec {
dhall-surgical-freeze = pkgs.haskell.lib.overrideSrc (hsuper.callPackage ./default.nix {}) {
src = filteredSource;
};
};
ghc924Pkgs = pkgs.haskell.packages.ghc924.override {
overrides = ghcOverrides;
};
ghc902Pkgs = pkgs.haskell.packages.ghc902.override {
overrides = ghcOverrides;
};
ghc8107Pkgs = pkgs.haskell.packages.ghc8107.override {
overrides = ghcOverrides;
};
ghc884Pkgs = pkgs.haskell.packages.ghc884.override {
overrides = ghcOverrides;
};
in rec {
packages = rec {
dev-env = ghc902Pkgs.shellFor {
packages = p: [p.dhall-surgical-freeze];
withHoogle = true;
buildInputs = [
pkgs.haskellPackages.cabal-install
(pkgs.haskell-language-server.override {supportedGhcVersions = ["902"];})
pkgs.haskellPackages.implicit-hie
pkgs.cabal2nix
# For cabal
pkgs.pkg-config
pkgs.binutils
# For CI
pkgs.jq
pkgs.dhall
pkgs.dhall-json
pkgs.fly
];
};
};
defaultPackage = packages.dev-env;
});
}