-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
196 lines (185 loc) · 6.3 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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
{
description = "navi flake";
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";
};
exception-utils = {
url = "github:tbidne/exception-utils";
inputs.flake-parts.follows = "flake-parts";
inputs.nix-hs-utils.follows = "nix-hs-utils";
inputs.nixpkgs.follows = "nixpkgs";
};
fs-utils = {
url = "github:tbidne/fs-utils";
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.nix-hs-utils.follows = "nix-hs-utils";
inputs.nixpkgs.follows = "nixpkgs";
inputs.algebra-simple.follows = "algebra-simple";
inputs.bounds.follows = "bounds";
inputs.exception-utils.follows = "exception-utils";
inputs.fs-utils.follows = "fs-utils";
inputs.smart-math.follows = "smart-math";
};
pythia = {
url = "github:tbidne/pythia";
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";
inputs.exception-utils.follows = "exception-utils";
inputs.fs-utils.follows = "fs-utils";
inputs.monad-effects.follows = "monad-effects";
inputs.si-bytes.follows = "si-bytes";
inputs.smart-math.follows = "smart-math";
inputs.time-conv.follows = "time-conv";
};
relative-time = {
url = "github:tbidne/relative-time";
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";
};
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";
};
time-conv = {
url = "github:tbidne/time-conv";
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";
inputs.exception-utils.follows = "exception-utils";
inputs.fs-utils.follows = "fs-utils";
inputs.monad-effects.follows = "monad-effects";
inputs.smart-math.follows = "smart-math";
};
};
outputs =
inputs@{
flake-parts,
monad-effects,
nix-hs-utils,
nixpkgs,
self,
...
}:
flake-parts.lib.mkFlake { inherit inputs; } {
perSystem =
{ pkgs, ... }:
let
ghc-version = "ghc9101";
compiler = pkgs.haskell.packages."${ghc-version}".override {
overrides =
final: prev:
{
# The latest dbus in nixpkgs, dbus_1_3_8, has compilation
# problems with doJailbreak, which we need for filepath.
# Hence the direct call here.
dbus = (
final.callHackageDirect {
pkg = "dbus";
ver = "1.3.10";
sha256 = "sha256-Of2aSeCzi5+LHyR+6aPxlCW/Oa8QfjwKrIieqs2h6YE=";
} { }
);
network = prev.network_3_2_4_0;
path = hlib.dontCheck prev.path_0_9_6;
}
// nix-hs-utils.mkLibs inputs final [
"algebra-simple"
"bounds"
"exception-utils"
"fs-utils"
"pythia"
"relative-time"
"si-bytes"
"smart-math"
"time-conv"
]
// nix-hs-utils.mkRelLibs "${monad-effects}/lib" final [
"effects-async"
"effects-env"
"effects-fs"
"effects-ioref"
"effects-logger-ns"
"effects-optparse"
"effects-stm"
"effects-time"
"effects-terminal"
"effects-thread"
"effects-typed-process"
"effects-unix-compat"
];
};
hlib = pkgs.haskell.lib;
mkPkg =
returnShellEnv:
nix-hs-utils.mkHaskellPkg {
inherit compiler pkgs returnShellEnv;
name = "navi";
root = ./.;
# TODO: Once hlint is back to working with our GHC we can
# use nix-hs-utils.mkDevTools ++ otherDeps.
devTools = [
(hlib.dontCheck compiler.cabal-fmt)
(hlib.dontCheck compiler.haskell-language-server)
pkgs.nixfmt-rfc-style
];
};
compilerPkgs = {
inherit compiler pkgs;
};
in
{
packages.default = mkPkg false;
devShells.default = mkPkg true;
apps = {
format = nix-hs-utils.format compilerPkgs;
#lint = nix-hs-utils.lint compilerPkgs;
#lint-refactor = nix-hs-utils.lint-refactor compilerPkgs;
};
};
systems = [
"aarch64-linux"
"x86_64-linux"
];
};
}