* boot.systemd -> systemd. * Add zabbix mailer script.
* boot.systemd -> systemd. * Add zabbix mailer script. svn path=/configurations/trunk/tud/; revision=34700
Eelco Dolstra committed
Mar 28, 2013 at 13:16 UTC
1481180a5f79634ed261304c640860ce0fb0a096
5 files changed
+39
-22
cartman.nix
+22
-5
@@ -4,6 +4,22 @@ with pkgs.lib;
4
5
let
6
7
+ zabbixMail = pkgs.writeScriptBin "zabbix-mail" ''
8
+ #!/bin/sh
9
+ set -e
10
+
11
+ export zabbixemailto="$1"
12
+ export zabbixsubject="$2"
13
+ export zabbixbody="$3"
14
+
15
+ ${pkgs.ssmtp}/sbin/sendmail -v $zabbixemailto <<EOF
16
+ Subject: $zabbixsubject
17
+ To: $zabbixemailto
18
+
19
+ $zabbixbody
20
+ EOF
21
+ '';
22
+
23
duplicityBackup = pkgs.writeScript "backup-duplicity" ''
24
#! /bin/sh
25
echo "Starting backups"
@@ -123,6 +139,7 @@ let
139
extraConfig =
140
''
141
$wgEmailConfirmToEdit = true;
142
+ $wgGroupPermissions['*']['createaccount'] = false;
143
'';
144
enableUploads = true;
145
uploadDir = "/data/nixos-mediawiki-upload";
@@ -635,7 +652,7 @@ rec {
652
# Needed for the Nixpkgs mirror script.
653
environment.pathsToLink = [ "/libexec" ];
654
638
- environment.systemPackages = [ pkgs.dnsmasq pkgs.duplicity];
655
+ environment.systemPackages = [ pkgs.dnsmasq pkgs.duplicity zabbixMail ];
656
657
jobs.dnsmasq =
658
let
@@ -671,9 +688,9 @@ rec {
688
};
689
690
# Use cgroups to limit Apache's resources.
674
- boot.systemd.services.httpd.serviceConfig.CPUShares = 1000;
675
- boot.systemd.services.httpd.serviceConfig.MemoryLimit = "1500M";
676
- boot.systemd.services.httpd.serviceConfig.ControlGroupAttribute = [ "memory.memsw.limit_in_bytes 1500M" ];
691
+ systemd.services.httpd.serviceConfig.CPUShares = 1000;
692
+ systemd.services.httpd.serviceConfig.MemoryLimit = "1500M";
693
+ systemd.services.httpd.serviceConfig.ControlGroupAttribute = [ "memory.memsw.limit_in_bytes 1500M" ];
694
695
users.extraUsers.tarball-mirror =
696
{ description = "Nixpkg starball mirroring user";
@@ -683,7 +700,7 @@ rec {
700
openssh.authorizedKeys.keys = singleton "ssh-dss AAAAB3NzaC1kc3MAAACBAOo3foMFsYvc+LEVVTAeXpaxdOFG6O2NE9coxZYN6UtwE477GwkvZ4uKymAekq3TB8I6dDg4QFfE27fIip/rQHJ/Rus+KsxwnTbwPzE0WcZVpkKQsepsoqLkfwMpiPfn5/oxcnJsimwRY/E95aJmmOHdGaYWrc0t4ARa+6teUgdFAAAAFQCSQq2Wil0/X4hDypGGUKlKvYyaWQAAAIAy/0fSDnz1tZOQBGq7q78y406HfWghErrVlrW9g+foJQG5pgXXcdJs9JCIrlaKivUKITDsYnQaCjrZaK8eHnc4ksbkSLfDOxFnR5814ulCftrgEDOv9K1UU3pYketjFMvQCA2U48lR6jG/99CPNXPH55QEFs8H97cIsdLQw9wM4gAAAIEAmzWZlXLzIf3eiHQggXqvw3+C19QvxQITcYHYVTx/XYqZi1VZ/fkY8bNmdcJsWFyOHgEhpEca+xM/SNvH/14rXDmt0wtclLEx/4GVLi59hQCnnKqv7HzJg8RF4v6XTiROBAEEdb4TaFuFn+JCvqPzilTzXTexvZKJECOvfYcY+10= eelco.dolstra@logicblox.com";
701
};
702
686
- boot.systemd.services.mirror-tarballs =
703
+ systemd.services.mirror-tarballs =
704
{ description = "Mirror Nixpkgs tarballs";
705
path = [ config.environment.nix pkgs.curl pkgs.git ];
706
#environment.DRY_RUN = "1";
common.nix
+2
-2
@@ -81,8 +81,8 @@ with pkgs.lib;
81
[ { domain = "*"; item = "nofile"; type = "-"; value = "16384"; }
82
];
83
84
- # Enable Kernel Samepage Merging (reduces memory footprint of VMs.
85
- boot.systemd.services."enable-ksm" =
84
+ # Enable Kernel Samepage Merging (reduces memory footprint of VMs).
85
+ systemd.services."enable-ksm" =
86
{ description = "Enable Kernel Same-Page Merging";
87
wantedBy = [ "multi-user.target" ];
88
after = [ "systemd-udev-settle.service" ];
hydra-module.nix
+4
-4
@@ -164,7 +164,7 @@ in
164
task = true;
165
};
166
167
- boot.systemd.services."hydra-server" =
167
+ systemd.services."hydra-server" =
168
{ wantedBy = [ "multi-user.target" ];
169
wants = [ "hydra-init.service" ];
170
after = [ "hydra-init.service" ];
@@ -176,7 +176,7 @@ in
176
};
177
};
178
179
- boot.systemd.services."hydra-queue-runner" =
179
+ systemd.services."hydra-queue-runner" =
180
{ wantedBy = [ "multi-user.target" ];
181
wants = [ "hydra-init.service" ];
182
after = [ "hydra-init.service" "network.target" ];
@@ -190,7 +190,7 @@ in
190
};
191
};
192
193
- boot.systemd.services."hydra-evaluator" =
193
+ systemd.services."hydra-evaluator" =
194
{ wantedBy = [ "multi-user.target" ];
195
wants = [ "hydra-init.service" ];
196
after = [ "hydra-init.service" "network.target" ];
@@ -203,7 +203,7 @@ in
203
};
204
};
205
206
- boot.systemd.services."hydra-update-gc-roots" =
206
+ systemd.services."hydra-update-gc-roots" =
207
{ wants = [ "hydra-init.service" ];
208
after = [ "hydra-init.service" ];
209
environment = env;
lucifer.nix
+10
-10
@@ -99,14 +99,14 @@
99
*/
100
101
# Set some cgroup limits.
102
- boot.systemd.services.sshd.serviceConfig.CPUShares = 2000;
103
- boot.systemd.services.nix-daemon.serviceConfig.CPUShares = 200;
104
- boot.systemd.services.nix-daemon.serviceConfig.BlockIOWeight = 500;
105
- boot.systemd.services.hydra-queue-runner.serviceConfig.CPUShares = 200;
106
- boot.systemd.services.hydra-evaluator.serviceConfig.CPUShares = 100;
107
- boot.systemd.services.hydra-server.serviceConfig.CPUShares = 700;
108
-
109
- boot.systemd.services.mirror-nixpkgs =
102
+ systemd.services.sshd.serviceConfig.CPUShares = 2000;
103
+ systemd.services.nix-daemon.serviceConfig.CPUShares = 200;
104
+ systemd.services.nix-daemon.serviceConfig.BlockIOWeight = 500;
105
+ systemd.services.hydra-queue-runner.serviceConfig.CPUShares = 200;
106
+ systemd.services.hydra-evaluator.serviceConfig.CPUShares = 100;
107
+ systemd.services.hydra-server.serviceConfig.CPUShares = 700;
108
+
109
+ systemd.services.mirror-nixpkgs =
110
{ description = "Mirror Nixpkgs";
111
wantedBy = [ "multi-user.target" ];
112
after = [ "networking.target" ];
@@ -120,7 +120,7 @@
120
serviceConfig.CPUShares = 100;
121
};
122
123
- boot.systemd.services.generate-nixpkgs-patches =
123
+ systemd.services.generate-nixpkgs-patches =
124
{ description = "Generate Nixpkgs Patches";
125
wantedBy = [ "multi-user.target" ];
126
path = [ pkgs.su ];
@@ -132,7 +132,7 @@
132
serviceConfig.CPUShares = 100;
133
};
134
135
- boot.systemd.services.mirror-nixos =
135
+ systemd.services.mirror-nixos =
136
{ description = "Mirror NixOS";
137
wantedBy = [ "multi-user.target" ];
138
after = [ "networking.target" ];
wendy.nix
+1
-1
@@ -118,5 +118,5 @@
118
];
119
};
120
121
- networking.firewall.allowedTCPPorts = [ 80 3000 3001 5432 ];
121
+ networking.firewall.allowedTCPPorts = [ 80 3000 3001 4000 5432 ];
122
}