-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
134 lines (122 loc) · 4.06 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
{
description = "A simple utility for deleting files";
inputs = {
# nix
flake-parts.url = "github:hercules-ci/flake-parts";
nix-hs-utils.url = "github:tbidne/nix-hs-utils";
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
# haskell
algebra-simple = {
url = "github:tbidne/algebra-simple";
inputs.flake-parts.follows = "flake-parts";
inputs.nix-hs-utils.follows = "nix-hs-utils";
inputs.nixpkgs.follows = "nixpkgs";
};
bounds = {
url = "github:tbidne/bounds";
inputs.flake-parts.follows = "flake-parts";
inputs.nix-hs-utils.follows = "nix-hs-utils";
inputs.nixpkgs.follows = "nixpkgs";
};
monad-effects = {
url = "github:tbidne/monad-effects";
inputs.flake-parts.follows = "flake-parts";
inputs.nixpkgs.follows = "nixpkgs";
inputs.algebra-simple.follows = "algebra-simple";
inputs.bounds.follows = "bounds";
inputs.nix-hs-utils.follows = "nix-hs-utils";
inputs.smart-math.follows = "smart-math";
};
path-size = {
url = "github:tbidne/path-size";
inputs.flake-parts.follows = "flake-parts";
inputs.nixpkgs.follows = "nixpkgs";
inputs.algebra-simple.follows = "algebra-simple";
inputs.bounds.follows = "bounds";
inputs.nix-hs-utils.follows = "nix-hs-utils";
inputs.si-bytes.follows = "si-bytes";
inputs.monad-effects.follows = "monad-effects";
inputs.smart-math.follows = "smart-math";
};
si-bytes = {
url = "github:tbidne/si-bytes";
inputs.flake-parts.follows = "flake-parts";
inputs.nix-hs-utils.follows = "nix-hs-utils";
inputs.nixpkgs.follows = "nixpkgs";
inputs.algebra-simple.follows = "algebra-simple";
inputs.bounds.follows = "bounds";
};
smart-math = {
url = "github:tbidne/smart-math";
inputs.flake-parts.follows = "flake-parts";
inputs.nix-hs-utils.follows = "nix-hs-utils";
inputs.nixpkgs.follows = "nixpkgs";
inputs.algebra-simple.follows = "algebra-simple";
inputs.bounds.follows = "bounds";
};
};
outputs =
inputs@{ flake-parts
, monad-effects
, nix-hs-utils
, nixpkgs
, self
, ...
}:
flake-parts.lib.mkFlake { inherit inputs; } {
perSystem = { pkgs, ... }:
let
ghc-version = "ghc963";
compiler = pkgs.haskell.packages."${ghc-version}".override {
overrides = final: prev: {
hedgehog = prev.hedgehog_1_4;
hlint = prev.hlint_3_6_1;
# because test depends on hedgehog < 1.3
nonempty-containers = hlib.dontCheck prev.nonempty-containers;
ormolu = prev.ormolu_0_7_2_0;
tasty-hedgehog = prev.tasty-hedgehog_1_4_0_2;
} // nix-hs-utils.mkLibs inputs final [
"algebra-simple"
"bounds"
"path-size"
"si-bytes"
"smart-math"
] // nix-hs-utils.mkRelLibs "${monad-effects}/lib" final [
"effects-async"
"effects-exceptions"
"effects-ioref"
"effects-fs"
"effects-logger-ns"
"effects-optparse"
"effects-stm"
"effects-terminal"
"effects-thread"
"effects-time"
"effects-unix-compat"
];
};
hlib = pkgs.haskell.lib;
compilerPkgs = { inherit compiler pkgs; };
mkPkg = returnShellEnv:
nix-hs-utils.mkHaskellPkg {
inherit compiler pkgs returnShellEnv;
name = "charon";
root = ./.;
};
hsDirs = "app benchmarks lib src test";
in
{
packages.default = mkPkg false;
devShells.default = mkPkg true;
apps = {
format = nix-hs-utils.format compilerPkgs;
lint = nix-hs-utils.lint compilerPkgs;
lintRefactor = nix-hs-utils.lintRefactor compilerPkgs;
};
};
systems = [
"x86_64-darwin"
"x86_64-linux"
];
};
}