svn path=/configurations/trunk/tud/; revision=18601
svn path=/configurations/trunk/tud/; revision=18601
Eelco Dolstra committed
Nov 24, 2009 at 16:07 UTC
551b11a1889c7504faad76114eb4acdd0d52aa7f
2 files changed
+44
-42
cartman.nix
+38
-42
@@ -1,5 +1,7 @@
1
{ config, pkgs, ... }:
2
3
+with pkgs.lib;
4
+
5
let
6
7
machines = import ./machines.nix;
@@ -11,7 +13,7 @@ let
13
{ sshKey = "/root/.ssh/id_buildfarm";
14
sshUser = machine.buildUser;
15
};
14
- in map addKey (pkgs.lib.filter (machine: machine ? buildUser) machines);
16
+ in map addKey (filter (machine: machine ? buildUser) machines);
17
18
jiraJetty = (import ../../services/jira/jira-instance.nix).jetty;
19
@@ -64,7 +66,7 @@ rec {
66
subnetMask = "255.255.254.0";
67
}
68
{ name = "eth0";
67
- ipAddress = (pkgs.lib.findSingle (m: m.hostName == "cartman") {} {} machines).ipAddress;
69
+ ipAddress = (findSingle (m: m.hostName == "cartman") {} {} machines).ipAddress;
70
}
71
];
72
@@ -73,8 +75,8 @@ rec {
75
nameservers = ["130.161.158.4" "130.161.33.17" "130.161.180.1"];
76
77
extraHosts =
76
- let toHosts = m: "${m.ipAddress} ${m.hostName} ${pkgs.lib.concatStringsSep " " (if m ? aliases then m.aliases else [])}\n"; in
77
- pkgs.lib.concatStrings (map toHosts machines);
78
+ let toHosts = m: "${m.ipAddress} ${m.hostName} ${concatStringsSep " " (if m ? aliases then m.aliases else [])}\n"; in
79
+ concatStrings (map toHosts machines);
80
81
localCommands =
82
# Provide NATting for the build machines on 192.168.1.*.
@@ -108,6 +110,7 @@ rec {
110
111
services = {
112
cron = {
113
+ mailto = "rob.vermaas@gmail.com";
114
systemCronJobs =
115
let indexJob = hour: dir: url:
116
"45 ${toString hour} * * * buildfarm (cd /etc/nixos/release/index && PATH=${pkgs.saxonb}/bin:$PATH ./make-index.sh ${dir} ${url} /releases.css) | ${pkgs.utillinux}/bin/logger -t index";
@@ -137,38 +140,9 @@ rec {
140
141
use-host-decl-names on;
142
'';
140
- machines = pkgs.lib.filter (machine: machine ? ethernetAddress) machines;
143
+ machines = filter (machine: machine ? ethernetAddress) machines;
144
};
145
143
- extraJobs = [
144
-
145
- { name = "jira";
146
- users = [
147
- { name = "jira";
148
- description = "JIRA bug tracker";
149
- }
150
- ];
151
- job = ''
152
- description "JIRA bug tracker"
153
-
154
- start on network-interfaces/started
155
- stop on network-interfaces/stop
156
-
157
- start script
158
- mkdir -p /var/log/jetty /var/cache/jira
159
- chown jira /var/log/jetty /var/cache/jira
160
- end script
161
-
162
- respawn ${pkgs.su}/bin/su -s ${pkgs.bash}/bin/sh jira -c '${jiraJetty}/bin/run-jetty'
163
-
164
- stop script
165
- ${pkgs.su}/bin/su -s ${pkgs.bash}/bin/sh jira -c '${jiraJetty}/bin/stop-jetty'
166
- end script
167
- '';
168
- }
169
-
170
- ];
171
-
146
postgresql = {
147
enable = true;
148
enableTCPIP = true;
@@ -212,7 +186,7 @@ rec {
186
virtualHosts = [
187
188
{ hostName = "buildfarm.st.ewi.tudelft.nl";
215
- documentRoot = pkgs.lib.cleanSource ./webroot;
189
+ documentRoot = cleanSource ./webroot;
190
enableUserDir = true;
191
extraSubservices = [
192
{ serviceType = "subversion";
@@ -339,6 +313,9 @@ rec {
313
{ urlPath = "/tarballs";
314
dir = "/data/webserver/tarballs";
315
}
316
+ { urlPath = "/irc";
317
+ dir = "/data/webserver/irc";
318
+ }
319
];
320
servedFiles = [
321
{ urlPath = "/releases/css/releases.css";
@@ -455,15 +432,34 @@ rec {
432
};
433
434
/*
458
- zabbixAgent = {
459
- enable = true;
460
- };
461
-
462
- zabbixServer = {
463
- enable = true;
464
- };
435
+ zabbixAgent.enable = true;
436
+ zabbixServer.enable = true;
437
*/
438
439
};
440
441
+ users.extraUsers = singleton
442
+ { name = "jira";
443
+ description = "JIRA bug tracker";
444
+ };
445
+
446
+ jobs.jira =
447
+ { description = "JIRA bug tracker";
448
+
449
+ startOn = "started network-interfaces";
450
+
451
+ preStart =
452
+ ''
453
+ mkdir -p /var/log/jetty /var/cache/jira
454
+ chown jira /var/log/jetty /var/cache/jira
455
+ '';
456
+
457
+ exec = "${pkgs.su}/bin/su -s ${pkgs.bash}/bin/sh jira -c '${jiraJetty}/bin/run-jetty'";
458
+
459
+ postStop =
460
+ ''
461
+ ${pkgs.su}/bin/su -s ${pkgs.bash}/bin/sh jira -c '${jiraJetty}/bin/stop-jetty'
462
+ '';
463
+ };
464
+
465
}
machines.nix
+6
@@ -112,4 +112,10 @@
112
ipAddress = "192.168.1.18";
113
ethernetAddress = "00:22:19:55:bf:24";
114
}
115
+
116
+ {
117
+ hostName = "chef";
118
+ ipAddress = "192.168.1.22";
119
+ ethernetAddress = "00:26:b9:35:bb:ca";
120
+ }
121
]