-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
69 lines (64 loc) · 2.39 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
{
description = "aeson-stream's flake";
inputs.haskellNix.url =
"github:input-output-hk/haskell.nix/c2f14344f119f68c10be2ea84fd372d8d8d16cd7";
inputs.nixpkgs.follows = "haskellNix/nixpkgs-unstable";
inputs.flake-utils.url = "github:numtide/flake-utils";
# We only have flake-compat here while we support nix-shell and
# nix-build, i.e. while we support non-flakes Nix usage.
inputs.flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
outputs = { self, nixpkgs, flake-utils, haskellNix, flake-compat }:
flake-utils.lib.eachSystem [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
] (system:
let
pkgs = import nixpkgs {
inherit system overlays;
inherit (haskellNix) config;
};
overlays = [
haskellNix.overlay
(final: prev:
let finalIohkPkgs = final.haskell-nix.haskellPackages;
in {
# This overlay adds our project to pkgs
aesonStreamProject = final.haskell-nix.project' {
src = ./.;
compiler-nix-name = "ghc8107";
modules = [{
# Work around https://github.com/input-output-hk/haskell.nix/issues/231. More info
# in aeson-stream.cabal
packages.aeson-stream.components.tests.aeson-stream-tests.build-tools =
[
finalIohkPkgs.hspec-discover.components.exes.hspec-discover
];
}];
# This is used by `nix develop .` to open a shell for use with
# `cabal`, `hlint` and `haskell-language-server`
shell.tools = {
cabal = "latest";
hlint = "latest";
haskell-language-server = "latest";
};
# Non-Haskell shell tools go here
shell.buildInputs = with pkgs; [
ghcid
haskellPackages.brittany # Brittany from the LTS is older than this
# finalIohkPkgs.brittany.components.exes.brittany
glibcLocales
];
shell.shellHook = ''
# source scripts/source-env.sh .env
'';
};
})
];
flake = pkgs.aesonStreamProject.flake { };
in flake);
}