This repository has been archived by the owner on Jul 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
/
flake.nix
101 lines (87 loc) · 3.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
{
description = "Theta is a tool for sharing algebraic data types between different languages. You can write a schema once, generate friendly bindings in Haskell, Python and Rust then share data between programs with Avro.";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs";
flake-utils.url = "github:numtide/flake-utils";
naersk-flake.url = "github:nix-community/naersk";
rust-overlay.url = "github:mozilla/nixpkgs-mozilla";
};
outputs = { self, nixpkgs, flake-utils, naersk-flake, rust-overlay }:
flake-utils.lib.eachDefaultSystem (system:
let
source-overrides = {
aeson = "2.0.3.0";
aeson-pretty = "0.8.9";
attoparsec = "0.14.4";
avro = "0.6.0.1";
hashable = "1.4.0.2";
OneTuple = "0.3.1";
PyF = "0.10.2.0";
quickcheck-instances = "0.3.27";
semialign = "1.2.0.1";
stache = "2.3.1";
streamly = "0.8.1.1";
streamly-bytestring = "0.1.4";
streamly-process = "0.2.0";
text-short = "0.1.5";
time-compat = "1.9.6.1";
unordered-containers = "0.2.16.0";
versions = "5.0.2";
};
overrides = new: old: {
foldl = pkgs.haskell.lib.doJailbreak old.foldl;
streamly-process = pkgs.haskell.lib.dontCheck old.streamly-process;
};
theta_8107 = import ./theta {
inherit pkgs source-overrides overrides;
compiler-version = "ghc8107";
};
theta_902 = import ./theta {
inherit pkgs source-overrides overrides;
compiler-version = "ghc902";
};
# default is 8.10.7 (for now?)
theta = theta_8107;
rust = import ./rust { inherit pkgs; };
python = import ./python { inherit pkgs; };
test = import ./test { inherit pkgs lib source-overrides overrides; };
theta-overlay = final: current: {
inherit theta;
theta-rust = rust;
theta-python = python;
};
haskell-overlay = final: current: {
all-cabal-hashes = current.fetchurl {
url = "https://github.com/commercialhaskell/all-cabal-hashes/archive/eb3b21c9f04e3a913efd61346bad427d92df3d1b.tar.gz";
sha256 = "0mm6y1zq1h7j17489fkyb18rfc2z0aglp5ly9f12jzhg5c6z85b7";
};
};
overlays = [
theta-overlay
haskell-overlay
rust-overlay.overlay
(import nix/overlays/rust.nix { inherit naersk-flake; })
(import nix/overlays/python.nix { python-version = "3.8"; })
];
pkgs = import nixpkgs { inherit system overlays; };
lib = {
theta-rust = import nix/lib/theta-rust.nix { inherit pkgs; };
theta-python = import nix/lib/theta-python.nix { inherit pkgs; };
};
in rec {
inherit overlays lib;
packages = {
inherit theta theta_8107 theta_902 rust python test;
};
devShells = {
theta = packages.theta.env;
theta_8107 = packages.theta_8107.env;
theta_902 = packages.theta_902.env;
rust = pkgs.mkShell {
nativeBuildInputs = pkgs.rust-dev-tools;
};
test = import ./test/shell.nix { inherit pkgs lib; };
};
defaultPackage = packages.theta;
});
}