svn path=/configurations/trunk/tud/; revision=16156
svn path=/configurations/trunk/tud/; revision=16156
Eelco Dolstra committed
Jul 3, 2009 at 09:20 UTC
22cfb18a2d7497d1b04610f794f18219addf38e7
1 file changed
+41
-1
hydra.nix
+41
-1
@@ -1,5 +1,20 @@
1
{config, pkgs, ...}:
2
3
+let
4
+
5
+ machines = import ./machines.nix;
6
+
7
+ # Produce the list of Nix build machines in the format expected by
8
+ # the Nix daemon Upstart job.
9
+ buildMachines =
10
+ let addKey = machine: machine //
11
+ { sshKey = "/root/.ssh/id_buildfarm";
12
+ sshUser = machine.buildUser;
13
+ };
14
+ in map addKey (pkgs.lib.filter (machine: machine ? buildUser) machines);
15
+
16
+in
17
+
18
{
19
boot = {
20
initrd = {
@@ -8,11 +23,17 @@
23
kernelModules = [ "acpi-cpufreq" "kvm-intel" ];
24
kernelPackages = pkgs.kernelPackages_2_6_28;
25
grubDevice = "/dev/sda";
26
+ copyKernels = true;
27
+
28
+ localCommands = ''
29
+ echo 60 > /proc/sys/kernel/panic
30
+ '';
31
};
32
33
fileSystems = [
34
{ mountPoint = "/";
35
label = "nixos";
36
+ options = "noatime";
37
}
38
];
39
@@ -21,12 +42,31 @@
42
];
43
44
nix = {
24
- maxJobs = 8;
45
+ maxJobs = 0;
46
+ distributedBuilds = true;
47
+ inherit buildMachines;
48
+
49
+ extraOptions = ''
50
+ gc-keep-outputs = true
51
+
52
+ # The default (`true') slows Nix down a lot since the build farm
53
+ # has so many GC roots.
54
+ gc-check-reachability = false
55
+
56
+ # Hydra needs caching of build failures.
57
+ build-cache-failure = true
58
+
59
+ build-poll-interval = 10
60
+ '';
61
};
62
63
networking = {
64
hostName = "hydra";
65
domain = "buildfarm";
66
+
67
+ extraHosts =
68
+ let toHosts = m: "${m.ipAddress} ${m.hostName} ${pkgs.lib.concatStringsSep " " (if m ? aliases then m.aliases else [])}\n"; in
69
+ pkgs.lib.concatStrings (map toHosts machines);
70
};
71
72
services = {