-
Notifications
You must be signed in to change notification settings - Fork 17
/
default.nix
131 lines (114 loc) · 4.8 KB
/
default.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
{ obelisk ? import ./dep/obelisk (builtins.removeAttrs args ["pkgs" "inNixShell"])
, pkgs ? obelisk.nixpkgs
, ... } @ args:
let
reflex-platform = obelisk.reflex-platform;
inherit (pkgs) lib;
haskellLib = pkgs.haskell.lib;
repos = pkgs.thunkSet ./dep;
# Some dependency thunks needed
dep = import ./dep reflex-platform.hackGet;
#TODO: Consider whether to prefer using thunkSet here.
# Local packages. We override them below so that other packages can use them.
rhyolitePackages = {
rhyolite-backend = ./backend;
rhyolite-beam-db = ./beam/db;
rhyolite-beam-orphans = ./beam/orphans;
rhyolite-beam-task-worker-types = ./beam/task/types;
rhyolite-beam-task-worker-backend = ./beam/task/backend;
rhyolite-notify-listen = ./notify-listen/notify-listen;
rhyolite-notify-listen-beam = ./notify-listen/notify-listen-beam;
psql-simple-class = ./psql-extras/psql-simple-class;
psql-simple-beam = ./psql-extras/psql-simple-beam;
psql-serializable = ./psql-extras/psql-serializable;
rhyolite-common = ./common;
rhyolite-email = ./email;
mime-mail-orphans = ./email/mime-mail-orphans;
semimap = ./semimap;
rhyolite-frontend = ./frontend;
signed-data = ./signed-data/signed-data;
signed-data-clientsession = ./signed-data/signed-data-clientsession;
rhyolite-widgets = ./widgets;
rhyolite-account-backend = ./account/backend;
rhyolite-account-types = ./account/types;
};
# srcs used for overrides
overrideSrcs = rhyolitePackages // {
bytestring-aeson-orphans = repos.bytestring-aeson-orphans;
monoid-map = repos.monoid-map;
postgresql-simple-interpolate = repos.postgresql-simple-interpolate;
# Newer versions than those in reflex-platform
gargoyle = repos.gargoyle + "/gargoyle";
gargoyle-postgresql = repos.gargoyle + "/gargoyle-postgresql";
gargoyle-postgresql-connect = repos.gargoyle + "/gargoyle-postgresql-connect";
gargoyle-postgresql-nix = repos.gargoyle + "/gargoyle-postgresql-nix";
push-notifications = repos.push-notifications;
vessel = repos.vessel;
postgresql-lo-stream = repos.postgresql-lo-stream;
beam-automigrate = repos.beam-automigrate;
};
# You can use these manually if you don’t want to use rhyolite.project.
# It will be needed if you need to combine with multiple overrides.
haskellOverrides = lib.foldr lib.composeExtensions (_: _: {}) [
(self: super: lib.mapAttrs (name: path: self.callCabal2nix name path {}) overrideSrcs)
(self: super: {
frontend = super.frontend.override {
obelisk-executable-config-lookup = self.obelisk-executable-config-lookup;
};
gargoyle-postgresql-nix = haskellLib.overrideCabal super.gargoyle-postgresql-nix {
librarySystemDepends = [ pkgs.postgresql ];
};
validation = haskellLib.dontCheck super.validation;
postgresql-lo-stream = haskellLib.markUnbroken super.postgresql-lo-stream;
HaskellNet-SSL = self.callHackage "HaskellNet-SSL" "0.3.4.4" {};
base-orphans = self.callHackageDirect {
pkg = "base-orphans";
ver = "0.8.6";
sha256 = "sha256:17hplm1mgw65jbszg5z4vqk4i24ilxv8mbszr3s8lhpll5naik26";
} {};
aeson-qq = self.callHackage "aeson-qq" "0.8.4" {};
postgresql-syntax = haskellLib.dontCheck super.postgresql-syntax;
vessel = haskellLib.doJailbreak super.vessel;
monoid-map = haskellLib.doJailbreak super.monoid-map;
beam-migrate = self.callHackage "beam-migrate" "0.5.2.0" {};
# 'locale' is broken on nix darwin which is required by postgres 'initdb'
rhyolite-beam-task-worker-backend = if pkgs.stdenv.hostPlatform.isDarwin
then
haskellLib.dontCheck super.rhyolite-beam-task-worker-backend
else
super.rhyolite-beam-task-worker-backend;
})
];
in obelisk // {
inherit haskellOverrides;
rhyolitePackages = haskellPackages: builtins.intersectAttrs rhyolitePackages (haskellPackages.extend haskellOverrides);
# Function similar to obelisk.project that handles overrides for you.
project = base: projectDefinition:
obelisk.project base ({...}@args:
let def = projectDefinition args;
in def // {
overrides = lib.composeExtensions haskellOverrides (def.overrides or (_: _: {}));
});
# Used to build this project. Should only be needed by CI, devs.
proj = obelisk.reflex-platform.project ({ pkgs, ... }@args: {
overrides = haskellOverrides;
packages = {
rhyolite-backend = ./backend;
rhyolite-common = ./common;
semimap = ./semimap;
rhyolite-frontend = ./frontend;
rhyolite-test-suite = ./test;
};
shells = rec {
ghc = [
"rhyolite-backend"
"rhyolite-test-suite"
] ++ ghcjs;
ghcjs = [
"rhyolite-common"
"rhyolite-frontend"
];
};
tools = ghc: [ pkgs.postgresql ];
});
}