-
Notifications
You must be signed in to change notification settings - Fork 201
/
Copy pathdevenv-module.nix
133 lines (121 loc) · 4.3 KB
/
devenv-module.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
/*
flake-parts module for setting the local IHP devenv shell
this is different from the devenv environment used by IHP apps!
that is defined in flake-module.nix
*/
{ inputs }:
{
perSystem = { nix-filter, pkgs, lib, ... }: let
ghcCompiler = import ./NixSupport/mkGhcCompiler.nix {
inherit pkgs;
ghcCompiler = pkgs.haskell.packages.ghc98;
ihp = ./.;
filter = inputs.nix-filter.lib;
};
in {
apps.migrate = {
type = "app";
program = "${ghcCompiler.ihp-migrate}/bin/migrate";
};
devenv.shells.default = {
packages = with pkgs; [];
containers = lib.mkForce {}; # https://github.com/cachix/devenv/issues/528
languages.haskell.enable = true;
languages.haskell.package =
ghcCompiler.ghc.withPackages (p: with p; [
# Copied from ihp.nix
base
classy-prelude
directory
string-conversions
warp
warp-systemd
wai
mtl
blaze-html
blaze-markup
wai-extra
http-types
inflections
text
postgresql-simple
wai-app-static
wai-util
aeson
uuid
wai-session
wai-session-clientsession
clientsession
pwstore-fast
template-haskell
haskell-src-meta
random-strings
interpolate
websockets
wai-websockets
mime-mail
mime-mail-ses
smtp-mail
attoparsec
case-insensitive
http-media
cookie
process
unix
fsnotify
countable-inflections
typerep-map
basic-prelude
data-default
regex-tdfa
resource-pool
wreq
deepseq
uri-encode
parser-combinators
ip
fast-logger
minio-hs
temporary
wai-cors
random
cereal-text
neat-interpolation
unagi-chan
with-utf8
# Development Specific Tools (not in ihp.nix)
hspec
ihp-hsx
ihp-postgresql-simple-extra
http-streams
HsOpenSSL
http-streams
io-streams
network-uri
]);
scripts.tests.exec = ''
runghc $(make -f lib/IHP/Makefile.dist print-ghc-extensions) -iihp-ide -iihp-ssc Test/Main.hs
'';
scripts.fastbuild.exec = ''
cabal build --flag FastBuild
'';
scripts.build-ihp-new.exec = ''
cd ProjectGenerator
make tarball.tar.gz
'';
scripts.build-api-reference.exec = ''
chmod +x build-haddock
./build-haddock
'';
languages.haskell.stack = null; # Stack is not used in IHP
languages.haskell.languageServer = ghcCompiler.haskell-language-server;
};
packages = {
default = ghcCompiler.ihp;
ide = ghcCompiler.ihp-ide;
ssc = ghcCompiler.ihp-ssc;
migrate = ghcCompiler.ihp-migrate;
datasync-typescript = ghcCompiler.ihp-datasync-typescript;
};
};
}