-
Notifications
You must be signed in to change notification settings - Fork 22
/
flake.nix
61 lines (54 loc) · 1.57 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
# To automatically load this flake into your shell:
# 1. Set up direnv and nix-direnv.
# 2. Create a file named ".envrc.local", with the contents `use flake`.
{
description = "Hasura GraphQL Engine";
inputs = {
nixpkgs = {
url = github:NixOS/nixpkgs/nixos-22.05;
};
flake-utils = {
url = github:numtide/flake-utils;
};
};
outputs =
{ self
, nixpkgs
, flake-utils
}:
let
ghcVersion = "8.10.7";
ghcName = "ghc${builtins.replaceStrings ["."] [""] ghcVersion}";
in
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
};
haskellCompiler = pkgs.haskell.compiler."${ghcName}";
haskellPackages = pkgs.haskell.packages."${ghcName}";
in
{
packages.default = (haskellPackages.callCabal2nix "graphql-parser" ./. { }).overrideScope (
self: super: {
hedgehog = self.hedgehog_1_1_1;
}
);
pkgs.formatter = nixpkgs.legacyPackages."${system}".nixpkgs-fmt;
devShells.default = pkgs.mkShell {
name = "graphql-parser-hs";
# We list top-level packages before packages scoped to the GHC version, so
# that they appear first in the PATH. Otherwise we might end up with older
# versions of transitive dependencies (e.g. HLS depending on Ormolu).
buildInputs = [
pkgs.cabal-install
pkgs.hlint
pkgs.ormolu
haskellCompiler
haskellPackages.ghcid
haskellPackages.haskell-language-server
];
};
}
);
}