Remove webdsl.nix
Eelco Dolstra committed
Jun 4, 2014 at 13:36 UTC
3b6f48f820623a58119141b9752c1834e29462bb
1 file changed
-344
delft/webdsl.nix
deleted
-344
@@ -1,344 +0,0 @@
1
-{ config, pkgs, ... }:
2
-
3
-let
4
-
5
- ZabbixApacheUpdater = pkgs.fetchsvn {
6
- url = https://www.zulukilo.com/svn/pub/zabbix-apache-stats/trunk/fetch.py ;
7
- sha256 = "1q66x429wpqjqcmlsi3x37rkn95i55nj8ldzcrblnx6a0jnjgd2g";
8
- rev = 94;
9
- };
10
-
11
- aselect = import ./aselect {
12
- inherit (pkgs) stdenv apacheHttpd libtool;
13
- };
14
-
15
- feedback = import ./aselect/feedback.nix {
16
- inherit (pkgs) stdenv;
17
- };
18
-in
19
-
20
-{
21
- require = [ ./common.nix ] ;
22
-
23
- boot.initrd.kernelModules = [ "mptsas" ];
24
- boot.kernelModules = ["acpi-cpufreq" "kvm-intel"];
25
-
26
- nix.maxJobs = 4;
27
-
28
- fileSystems =
29
- [ { mountPoint = "/";
30
- label = "nixos";
31
- }
32
- { mountPoint = "/data";
33
- label = "data";
34
- }
35
- ];
36
-
37
- jobs.aselect = {
38
- name = "aselect";
39
-
40
- startOn = "started httpd";
41
-
42
- preStart = ''
43
- if [ ! -d /var/lib/aselect ]
44
- then
45
- mkdir -p /var/lib/aselect/log/aselectagent/system
46
- cp -a ${aselect}/work /var/lib/aselect
47
- chmod -R u+rw /var/lib/aselect
48
- cp ${feedback}/* /var/lib/aselect/work/aselectagent
49
- fi
50
- '';
51
-
52
- preStop = "${pkgs.jdk}/bin/java -classpath \"${aselect}/bin/aselectagent/\" StopAgent";
53
-
54
- exec = "${pkgs.jdk}/bin/java -Duser.dir=\"/var/lib/aselect/work/aselectagent\" -server -jar \"${aselect}/bin/aselectagent/org.aselect.agent.jar\"";
55
- };
56
-
57
- services.ttyBackgrounds.enable = false;
58
-
59
- services.zabbixAgent.extraConfig = ''
60
- UserParameter=mysql_threads,${pkgs.mysql}/bin/mysqladmin -uroot status|cut -f3 -d":"|cut -f1 -d"Q"
61
- UserParameter=mysql_questions,${pkgs.mysql}/bin/mysqladmin -uroot status|cut -f4 -d":"|cut -f1 -d"S"
62
- UserParameter=mysql_qps,${pkgs.mysql}/bin/mysqladmin -uroot status|cut -f9 -d":"
63
- '';
64
-
65
- services.systemhealth = {
66
- enable = true;
67
- interfaces = [ "lo" "eth0" ];
68
- drives = [
69
- { name = "root"; path = "/"; }
70
- { name = "data"; path = "/data"; }
71
- ];
72
- };
73
-
74
- services.vsftpd = {
75
- enable = true;
76
- anonymousUser = true;
77
- };
78
-
79
- services.mysql = {
80
- enable = true;
81
- package = pkgs.mysql51;
82
- dataDir = "/data/mysql";
83
- };
84
-
85
- services.syslogd.extraConfig = ''
86
- local0.* -/var/log/pgsql
87
- '';
88
-
89
- services.postgresql = {
90
- enable = true;
91
- enableTCPIP = true;
92
- dataDir = "/data/postgresql";
93
- extraConfig = ''
94
- #log_min_duration_statement = 1000
95
- #log_duration = off
96
- #log_statement = 'none'
97
- max_connections = 250
98
- '';
99
- authentication = ''
100
- local all mediawiki ident mediawiki-users
101
- local all all ident sameuser
102
- host all all 127.0.0.1/32 md5
103
- host all all ::1/128 md5
104
- host all all 130.161.159.80/32 md5
105
- host all all 130.161.158.181/32 md5
106
- host all all 94.208.39.185/32 md5
107
- '';
108
- };
109
-
110
- services.httpd = rec {
111
- enable = true;
112
- adminAddr = "rob.vermaas@gmail.com";
113
-
114
- logPerVirtualHost = true;
115
- logDir = "/data/www/logs";
116
- logFormat = "combined";
117
-
118
- extraConfig = ''
119
- <Location /server-status>
120
- SetHandler server-status
121
- Allow from 127.0.0.1 # If using a remote host for monitoring replace 127.0.0.1 with its IP.
122
- Order deny,allow
123
- Deny from all
124
- </Location>
125
-
126
- ExtendedStatus On
127
-
128
- <IfModule mod_aselect_filter.c>
129
-
130
- # The location of the error template
131
- aselect_filter_set_html_error_template "${aselect}/apachefilter/conf/error_template.html"
132
-
133
- # A-Select Agent IP and port
134
- aselect_filter_set_agent_address "127.0.0.1"
135
- aselect_filter_set_agent_port "1495"
136
-
137
- # Applications to protect
138
- aselect_filter_add_secure_app "/evaluaties" "tudfeedb39de56" "default"
139
- aselect_filter_add_secure_app "/weblab" "tudfeedb39de56" "default"
140
- # Global options
141
- aselect_filter_set_use_aselect_bar "0"
142
- aselect_filter_set_redirect_mode "full"
143
-
144
- # Authorization
145
- #aselect_filter_add_authz_rule "app1" "*" "ip=127.0.0.1"
146
-
147
- </IfModule>
148
-
149
- '';
150
-
151
- extraSubservices = [
152
- { serviceType = "tomcat-connector";
153
- inherit logDir ;
154
- stateDir = "/var/run/httpd";
155
- extraWorkersProperties = ''
156
- worker.list=loadbalancer,loadbalancer2,status
157
-
158
- # modify the host as your host IP or DNS name.
159
- worker.node2.port=8010
160
- worker.node2.host=localhost
161
- worker.node2.type=ajp13
162
- worker.node2.lbfactor=1
163
-
164
- # Load-balancing behaviour
165
- worker.loadbalancer2.type=lb
166
- worker.loadbalancer2.balance_workers=node2
167
- '';
168
- }
169
- ];
170
-
171
- extraModules = [
172
- { name = "aselect_filter"; path = "${aselect}/modules/mod_aselect_filter.so"; }
173
- ];
174
-
175
-
176
- virtualHosts = [
177
-
178
-
179
- { hostName = "webdsl.org";
180
- extraConfig = ''
181
-JkMount /* loadbalancer
182
- '';
183
- }
184
-
185
- { hostName = "researchr.org";
186
- extraConfig = ''
187
-JkMount /* loadbalancer2
188
- '';
189
- }
190
-
191
- { hostName = "department.st.ewi.tudelft.nl";
192
- enableSSL = true;
193
- sslServerCert = "/root/server.crt";
194
- sslServerKey = "/root/server.key.insecure";
195
- extraConfig = ''
196
-JkMount /* loadbalancer
197
- '';
198
- }
199
-
200
- /*{ hostName = "department.st.ewi.tudelft.nl"; }
201
-
202
- { hostName = "tweetview.net"; }
203
- { hostName = "pil-lang.org"; }
204
- { hostName = "department.st.ewi.tudelft.nl"; }
205
- { hostName = "phaedrus.webdsl.org"; }
206
- { hostName = "book.webdsl.org"; }
207
- { hostName = "yellowgrass.org"; }
208
- { hostName = "www.yellowgrass.org"; }
209
- { hostName = "eelcovisser.org"; }
210
- { hostName = "dsl-engineering.org"; }*/
211
- ];
212
- };
213
-
214
- services.xserver.enable = true;
215
- jobs.tomcat.environment.DISPLAY = ":0.0";
216
- jobs.tomcat.path = [ pkgs.wkhtmltopdf ];
217
-
218
- services.tomcat = {
219
- enable = true;
220
- baseDir = "/data/tomcat";
221
- javaOpts = "-Dshare.dir=/nix/var/nix/profiles/default/share -Xms350m -Xss8m -Xmx8G -Djava.security.egd=file:/dev/./urandom -XX:MaxPermSize=512M -XX:PermSize=512M -XX:-UseGCOverheadLimit -XX:+UseCompressedOops "
222
- + "-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=8999 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Djava.rmi.server.hostname=localhost "
223
- + "-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/data/tomcat/logs/java_pid<pid>.hprof -Dorg.apache.tomcat.util.http.ServerCookie.ALLOW_EQUALS_IN_VALUE=true";
224
- logPerVirtualHost = true;
225
- virtualHosts = [
226
- { name = "examinr.org";}
227
- { name = "researchr.org";}
228
- { name = "webdsl.org"; }
229
- { name = "tweetview.net"; }
230
- { name = "pil-lang.org"; }
231
- { name = "department.st.ewi.tudelft.nl"; }
232
- { name = "phaedrus.webdsl.org"; }
233
- { name = "book.webdsl.org"; }
234
- { name = "yellowgrass.org"; }
235
- { name = "www.yellowgrass.org"; }
236
- { name = "eelcovisser.org"; }
237
- { name = "dsl-engineering.org"; }
238
- ];
239
- };
240
-
241
- services.mysqlBackup = {
242
- enable = true;
243
- user = "root";
244
- databases = [ "researchr" "twitterarchive" "webdslorg" "pilweb" "mysql" "yellowgrass" "department" "weblab" ];
245
- singleTransaction = true;
246
- split = true;
247
- extraArgs = "--ignore-table=researchr._SecurityContext --ignore-table=researchr.RequestLogEntry_params_RequestLogEntryParam --ignore-table=researchr._RequestLogEntry --ignore-table=researchr._RequestLogEntryParam --ignore-table=researchr._RequestLogEntry --ignore-table=researchr._RequestLogEntryParam --ignore-table=researchr.RequestLogEntry_params_RequestLogEntryParam";
248
- };
249
-
250
- users = {
251
- extraUsers = let shell = "/var/run/current-system/sw/bin/bash"; in [
252
- { name = "rbvermaa";
253
- uid = 1000;
254
- group = "users";
255
- extraGroups = [ "wheel" ];
256
- description = "Rob Vermaas";
257
- home = "/home/rbvermaa";
258
- inherit shell;
259
- createHome = true;
260
- }
261
- { name = "zef";
262
- uid = 1001;
263
- group = "users";
264
- extraGroups = [ "wheel" ];
265
- description = "Zef Hemel";
266
- home = "/home/zef";
267
- inherit shell;
268
- createHome = true;
269
- }
270
- { name = "eelcovisser";
271
- uid = 1002;
272
- group = "users";
273
- extraGroups = [ "wheel" ];
274
- description = "Eelco Visser";
275
- home = "/home/eelcovisser";
276
- inherit shell;
277
- createHome = true;
278
- }
279
- { name = "sander";
280
- uid = 1003;
281
- group = "users";
282
- extraGroups = [ "wheel" ];
283
- description = "Sander van der Burg";
284
- home = "/home/sander";
285
- inherit shell;
286
- createHome = true;
287
- }
288
- { name = "danny";
289
- uid = 1004;
290
- group = "users";
291
- extraGroups = [ "wheel" ];
292
- description = "Danny Groenewegen";
293
- home = "/home/danny";
294
- inherit shell;
295
- createHome = true;
296
- }
297
- ];
298
- };
299
-
300
-
301
- ######## copied from common ###########
302
-
303
- boot.loader.grub.device = "/dev/sda";
304
- boot.loader.grub.copyKernels = true;
305
- boot.kernelPackages = pkgs.linuxPackages_2_6_35;
306
-
307
- swapDevices = [ { label = "swap"; } ];
308
-
309
- nix.extraOptions =
310
- ''
311
- build-max-silent-time = 3600
312
- '';
313
-
314
- services.sshd.permitRootLogin = "no";
315
-
316
- services.cron.systemCronJobs =
317
- [ "15 03 * * * root ${pkgs.nixUnstable}/bin/nix-collect-garbage --max-freed $((32 * 1024**3)) > /var/log/gc.log 2>&1"
318
- "* * * * * root ${pkgs.python}/bin/python ${ZabbixApacheUpdater} -z buildfarm.st.ewi.tudelft.nl -c webdsl"
319
- "05 05 * * * root cp -v /var/backup/mysql/* /backup/webdsl/mysql/"
320
- ];
321
-
322
- networking = {
323
- defaultGateway = "130.161.158.1";
324
- hostName = "webdsl";
325
- domain = "st.ewi.tudelft.nl";
326
- extraHosts = "127.0.0.2 webdsl.st.ewi.tudelft.nl webdsl researchr.org department.st.ewi.tudelft.nl "+
327
- "webdsl.org tweetview.net pil-lang.org phaedrus.webdsl.org book.webdsl.org "+
328
- "yellowgrass.org www.yellowgrass.org eelcovisser.org dsl-engineering.org";
329
-
330
- interfaces = [ { ipAddress = "130.161.159.114"; name = "eth0"; subnetMask = "255.255.254.0"; } ];
331
- nameservers = [ "130.161.180.1" "130.161.180.65" ];
332
-
333
- useDHCP = false;
334
-
335
- defaultMailServer = {
336
- directDelivery = true;
337
- hostName = "smtp.tudelft.nl";
338
- domain = "st.ewi.tudelft.nl";
339
- };
340
-
341
- };
342
-
343
- environment.systemPackages = [ pkgs.stdenv pkgs.clang pkgs.llvm /*pkgs.lsiutil*/ ] ++ (with pkgs.strategoPackages018; [ aterm sdf strategoxt ]) ;
344
-}