Skip to content

Commit 85599b9

Browse files
authored
Build servant repo with nix. (#1288)
1 parent e7bdd09 commit 85599b9

File tree

3 files changed

+46
-0
lines changed

3 files changed

+46
-0
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
**/*/dist
2+
*~
23
dist-*
34
.ghc.environment.*
45
/bin
@@ -30,5 +31,8 @@ doc/venv
3031
doc/tutorial/static/api.js
3132
doc/tutorial/static/jq.js
3233

34+
# nix
35+
result*
36+
3337
# local versions of things
3438
servant-multipart

default.nix

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
with (builtins.fromJSON (builtins.readFile ./nix/nixpkgs.json));
2+
{
3+
pkgs ? import (builtins.fetchTarball {
4+
url = "https://github.com/NixOS/nixpkgs/archive/${rev}.tar.gz";
5+
inherit sha256;
6+
}) {}
7+
, compiler ? "ghc883"
8+
}:
9+
let
10+
overrides = self: super: {
11+
servant = self.callCabal2nix "servant" ./servant {};
12+
servant-docs = self.callCabal2nix "servant-docs" ./servant-docs {};
13+
servant-pipes = self.callCabal2nix "servant-pipes" ./servant-pipes {};
14+
servant-server = self.callCabal2nix "servant-server" ./servant-server {};
15+
servant-client = self.callCabal2nix "servant-client" ./servant-client {};
16+
servant-foreign = self.callCabal2nix "servant-foreign" ./servant-foreign {};
17+
servant-conduit = self.callCabal2nix "servant-conduit" ./servant-conduit {};
18+
servant-machines = self.callCabal2nix "servant-machines" ./servant-machines {};
19+
servant-client-core = self.callCabal2nix "servant-client-core" ./servant-client-core {};
20+
servant-http-streams = self.callCabal2nix "servant-http-streams" ./servant-http-streams {};
21+
};
22+
hPkgs = pkgs.haskell.packages.${compiler}.override { inherit overrides; };
23+
in
24+
with hPkgs;
25+
{
26+
inherit
27+
servant
28+
servant-client
29+
servant-client-core
30+
servant-conduit
31+
servant-docs
32+
servant-foreign
33+
servant-http-streams
34+
servant-machines
35+
servant-pipes
36+
servant-server;
37+
}
38+

nix/nixpkgs.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"rev" : "05f0934825c2a0750d4888c4735f9420c906b388",
3+
"sha256" : "1g8c2w0661qn89ajp44znmwfmghbbiygvdzq0rzlvlpdiz28v6gy"
4+
}

0 commit comments

Comments
 (0)