-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
81 lines (73 loc) · 2.35 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
72
73
74
75
76
77
78
79
80
81
{
inputs = {
haskellNix = {
url = "github:input-output-hk/haskell.nix";
# prevent nix-direnv from fetching stackage
inputs.stackage.url = "github:input-output-hk/empty-flake";
};
nixpkgs.follows = "haskellNix/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
# for Ormolu Live
ghc-wasm-meta.url = "gitlab:ghc/ghc-wasm-meta?host=gitlab.haskell.org";
};
outputs = inputs@{ self, nixpkgs, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
inherit (inputs.haskellNix) config;
overlays = [ inputs.haskellNix.overlay ];
};
inherit (pkgs) lib haskell-nix;
inherit (haskell-nix) haskellLib;
ghcVersions = [ "ghc964" ];
defaultGHCVersion = builtins.head ghcVersions;
perGHC = lib.genAttrs ghcVersions (ghcVersion:
let
hsPkgs = pkgs.haskell-nix.cabalProject {
src = ./.;
compiler-nix-name = ghcVersion;
};
packages = lib.recurseIntoAttrs ({
dev = { inherit hsPkgs; };
});
in packages
);
defaultGHC = perGHC.${defaultGHCVersion};
wasmSolver = import wasm-solver/default.nix {
inherit pkgs inputs defaultGHC;
};
in
{
devShells = {
default = defaultGHC.dev.hsPkgs.shellFor {
tools = {
cabal = "latest";
haskell-language-server = "2.7.0.0";
};
buildInputs = with pkgs; [
haskellPackages.ormolu_0_5_2_0
haskellPackages.cabal-fmt
haskellPackages.graphmod
haskellPackages.hlint
haskellPackages.markdown-unlit
];
withHoogle = false;
exactDeps = false;
};
wasmSolver = wasmSolver.shell;
ghcWasm = wasmSolver.ghcWasmShell;
};
legacyPackages = defaultGHC // perGHC;
});
nixConfig = {
extra-substituters = [
"https://cache.iog.io"
"https://tweag-ormolu.cachix.org"
];
extra-trusted-public-keys = [
"hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ="
"tweag-ormolu.cachix.org-1:3O4XG3o4AGquSwzzmhF6lov58PYG6j9zHcTDiROqkjM="
];
};
}