@cryptotaxi247 / infra-1 / commits / 0ffdf7ee

* On hydra, fixed the cronjob for hydra_update_gc_roots.pl, and run the garbage collector to make sure that at least 100 GiB is free (i.e. run with --max-freed `100 GiB - available disk space on /nix/store`). * Factor out some commonality between configurations into common.nix.

* On hydra, fixed the cronjob for hydra_update_gc_roots.pl, and run the garbage collector to make sure that at least 100 GiB is free (i.e. run with --max-freed `100 GiB - available disk space on /nix/store`). * Factor out some commonality between configurations into common.nix. svn path=/configurations/trunk/tud/; revision=18600

Eelco Dolstra committed Nov 24, 2009 at 15:18 UTC 0ffdf7ee4451b415bf0e6052dd0f841b8477e14b
5 files changed +21 -33
build-db-dell-R410.nix
+1 -10
@@ -2,7 +2,7 @@
2
3 {
4 # require = [ ./build-machines-common.nix ];
5 - require = [ ./couchdb.nix ] ;
5 + require = [ ./common.nix ./couchdb.nix ] ;
6
7 boot.initrd.extraKernelModules = ["uhci_hcd" "ehci_hcd" "ata_piix" "mptsas" "usbhid" "ext3"];
8 boot.kernelModules = ["acpi-cpufreq" "kvm-intel"];
@@ -90,11 +90,6 @@
90 boot.kernelPackages = pkgs.kernelPackages_2_6_29;
91 boot.copyKernels = true;
92
93 - boot.postBootCommands =
94 - ''
95 - echo 60 > /proc/sys/kernel/panic
96 - '';
97 -
93 swapDevices = [ { label = "swap"; } ];
94
95 nix.extraOptions =
@@ -102,8 +97,6 @@
97 build-max-silent-time = 3600
98 '';
99
105 - services.sshd.enable = true;
106 -
100 services.cron.systemCronJobs =
101 [ "15 03 * * * root ${pkgs.nixUnstable}/bin/nix-collect-garbage --max-freed $((32 * 1024**3)) > /var/log/gc.log 2>&1"
102 ];
@@ -138,6 +131,4 @@
131 ( genericBackup // { name = "tomcat"; local = config.services.tomcat.baseDir; remote = "/staff-groups/ewi/st/strategoxt/backup/tomcat"; } )
132 ];
133 };
141 -
142 - environment.systemPackages = [pkgs.emacs];
134 }
build-machines-common.nix
+2 -9
@@ -1,15 +1,12 @@
1 { config, pkgs, ... }:
2
3 {
4 + require = [ ./common.nix ];
5 +
6 boot.grubDevice = "/dev/sda";
7 boot.kernelPackages = pkgs.kernelPackages_2_6_29;
8 boot.copyKernels = true;
9
8 - boot.postBootCommands =
9 - ''
10 - echo 60 > /proc/sys/kernel/panic
11 - '';
12 -
10 fileSystems =
11 [ { mountPoint = "/";
12 label = "nixos";
@@ -24,13 +21,9 @@
21 build-max-silent-time = 3600
22 '';
23
27 - services.sshd.enable = true;
28 -
24 services.cron.systemCronJobs =
25 [ "15 03 * * * root ${pkgs.nixUnstable}/bin/nix-collect-garbage --max-freed $((32 * 1024**3)) > /var/log/gc.log 2>&1"
26 ];
27
28 networking.hostName = ""; # obtain from DHCP server
34 -
35 - environment.systemPackages = [pkgs.emacs];
29 }
\ No newline at end of file
cartman.nix
+1 -4
@@ -22,6 +22,7 @@ let
22 in
23
24 rec {
25 + require = [ ./common.nix ];
26
27 boot = {
28 grubDevice = "/dev/sda";
@@ -106,10 +107,6 @@ rec {
107 };
108
109 services = {
109 - sshd = {
110 - enable = true;
111 - };
112 -
110 cron = {
111 systemCronJobs =
112 let indexJob = hour: dir: url:
common.nix new
+12
@@ -0,0 +1,12 @@
1 +{ config, pkgs, ... }:
2 +
3 +{
4 + environment.systemPackages = [ pkgs.emacs pkgs.subversion ];
5 +
6 + services.sshd.enable = true;
7 +
8 + boot.postBootCommands =
9 + ''
10 + echo 60 > /proc/sys/kernel/panic
11 + '';
12 +}
hydra.nix
+5 -10
@@ -16,6 +16,8 @@ let
16 in
17
18 {
19 + require = [ ./common.nix ];
20 +
21 boot = {
22 initrd = {
23 extraKernelModules = [ "uhci_hcd" "ehci_hcd" "ata_piix" "mptsas" "usbhid" "ext4" ];
@@ -24,10 +26,6 @@ in
26 kernelPackages = pkgs.kernelPackages_2_6_29;
27 grubDevice = "/dev/sda";
28 copyKernels = true;
27 -
28 - postBootCommands = ''
29 - echo 60 > /proc/sys/kernel/panic
30 - '';
29 };
30
31 fileSystems = [
@@ -77,13 +75,10 @@ in
75
76 services = {
77
80 - sshd = {
81 - enable = true;
82 - };
83 -
78 cron.systemCronJobs =
85 - [ "15 02 * * * hydra /nix/var/nix/profiles/per-user/hydra/profile/bin/hydra_update_gc_roots.pl > /home/hydra/gc-roots.log 2>&1"
86 - "15 03 * * * root ${pkgs.nixUnstable}/bin/nix-collect-garbage --max-freed $((64 * 1024**3)) > /var/log/gc.log 2>&1"
79 + [ "15 02 * * * hydra source /home/hydra/.bashrc; /nix/var/nix/profiles/per-user/hydra/profile/bin/hydra_update_gc_roots.pl > /home/hydra/gc-roots.log 2>&1"
80 + # Make sure that at least 100 GiB of disk space is available.
81 + "15 03 * * * root nix-store --gc --max-freed \"$((100 * 1024**3 - 1024 * $(df /nix/store | tail -n 1 | awk '{ print $4 }')))\" > /var/log/gc.log 2>&1"
82 ];
83
84 };