diff --git a/lib/test-driver/log2html.xsl b/lib/test-driver/log2html.xsl
index 0123fc537606..8e907d85ffac 100644
--- a/lib/test-driver/log2html.xsl
+++ b/lib/test-driver/log2html.xsl
@@ -9,8 +9,8 @@
-
-
+
+
Log File
@@ -37,18 +37,18 @@
-
+
-
+
-
+
display: none;
@@ -60,19 +60,19 @@
-
+
-
+
linelastline
-
+
-
@@ -82,10 +82,10 @@
-
+
-
+
@@ -101,7 +101,7 @@
serial
-
+
@@ -112,7 +112,7 @@
-
+
@@ -120,16 +120,16 @@
-
+
-
+
/...
-
-
\ No newline at end of file
+
+
diff --git a/lib/testing.nix b/lib/testing.nix
index 7c5bb5d50f7d..9a72e1f4bd51 100644
--- a/lib/testing.nix
+++ b/lib/testing.nix
@@ -53,8 +53,6 @@ rec {
xsltproc --output $out/log.html ${./test-driver/log2html.xsl} $out/log.xml
ln -s ${./test-driver/logfile.css} $out/logfile.css
ln -s ${./test-driver/treebits.js} $out/treebits.js
- ln -s ${pkgs.jquery_ui}/js/jquery.min.js $out/
- ln -s ${pkgs.jquery_ui}/js/jquery-ui.min.js $out/
touch $out/nix-support/hydra-build-products
echo "report testlog $out log.html" >> $out/nix-support/hydra-build-products
diff --git a/maintainers/scripts/ec2/create-ebs-amis.py b/maintainers/scripts/ec2/create-ebs-amis.py
index 9f5ded304988..93971ac9504d 100755
--- a/maintainers/scripts/ec2/create-ebs-amis.py
+++ b/maintainers/scripts/ec2/create-ebs-amis.py
@@ -4,14 +4,16 @@ import os
import sys
import time
import argparse
-import charon.util
-from charon import deployment
+import nixops.util
+from nixops import deployment
from boto.ec2.blockdevicemapping import BlockDeviceMapping, BlockDeviceType
+import boto.ec2
parser = argparse.ArgumentParser(description='Create an EBS-backed NixOS AMI')
-parser.add_argument('--region', dest='region', required=True, help='EC2 region')
-parser.add_argument('--keep', dest='keep', action='store_true', help='Keep Charon machine after use')
+parser.add_argument('--region', dest='region', required=True, help='EC2 region to create the image in')
+parser.add_argument('--keep', dest='keep', action='store_true', help='Keep NixOps machine after use')
parser.add_argument('--hvm', dest='hvm', action='store_true', help='Create HVM image')
+parser.add_argument('--key', dest='key_name', action='store_true', help='Keypair used for HVM instance creation', default="rob")
args = parser.parse_args()
instance_type = "cc1.4xlarge" if args.hvm else "m1.small"
@@ -67,7 +69,7 @@ m.run_command("nix-channel --update")
m.run_command("nixos-rebuild switch")
version = m.run_command("nixos-version", capture_stdout=True).replace('"', '').rstrip()
print >> sys.stderr, "NixOS version is {0}".format(version)
-m.run_command("cp -f $(nix-instantiate --find-file nixos/modules/virtualisation/amazon-config.nix) /mnt/etc/nixos/configuration.nix")
+m.upload_file("./amazon-base-config.nix", "/mnt/etc/nixos/configuration.nix")
m.run_command("nixos-install")
if args.hvm:
m.run_command('cp /mnt/nix/store/*-grub-0.97*/lib/grub/i386-pc/* /mnt/boot/grub')
@@ -98,24 +100,24 @@ volume = m._conn.get_all_volumes([], filters={'attachment.instance-id': m.resour
if args.hvm:
instance = m._conn.run_instances( image_id="ami-6a9e4503"
, instance_type=instance_type
- , key_name=key_name
+ , key_name=args.key_name
, placement=m.zone
, security_groups=["eelco-test"]).instances[0]
- charon.util.check_wait(lambda: instance.update() == 'running', max_tries=120)
+ nixops.util.check_wait(lambda: instance.update() == 'running', max_tries=120)
instance.stop()
- charon.util.check_wait(lambda: instance.update() == 'stopped', max_tries=120)
+ nixops.util.check_wait(lambda: instance.update() == 'stopped', max_tries=120)
old_root_volume = m._conn.get_all_volumes([], filters={'attachment.instance-id': instance.id, 'attachment.device': "/dev/sda1"})[0]
old_root_volume.detach()
volume.detach()
- charon.util.check_wait(lambda: volume.update() == 'available', max_tries=120)
- charon.util.check_wait(lambda: old_root_volume.update() == 'available', max_tries=120)
+ nixops.util.check_wait(lambda: volume.update() == 'available', max_tries=120)
+ nixops.util.check_wait(lambda: old_root_volume.update() == 'available', max_tries=120)
volume.attach(instance.id, '/dev/sda1')
- charon.util.check_wait(lambda: volume.update() == 'in-use', max_tries=120)
+ nixops.util.check_wait(lambda: volume.update() == 'in-use', max_tries=120)
ami_id = m._conn.create_image(instance.id, ami_name, description)
time.sleep(5)
image = m._conn.get_all_images([ami_id])[0]
- charon.util.check_wait(lambda: image.update() == 'available', max_tries=120)
+ nixops.util.check_wait(lambda: image.update() == 'available', max_tries=120)
instance.terminate()
else:
@@ -123,7 +125,7 @@ else:
snapshot = volume.create_snapshot(description=description)
print >> sys.stderr, "created snapshot {0}".format(snapshot.id)
- charon.util.check_wait(check, max_tries=120)
+ nixops.util.check_wait(check, max_tries=120)
m._conn.create_tags([snapshot.id], {'Name': ami_name})
@@ -160,7 +162,6 @@ print >> sys.stderr, "making image public..."
image = m._conn.get_all_images(image_ids=[ami_id])[0]
image.set_launch_permissions(user_ids=[], group_names=["all"])
-
# Do a test deployment to make sure that the AMI works.
f = open("ebs-test.nix", "w")
f.write(
@@ -190,11 +191,30 @@ test_depl.name = "ebs-creator-test"
test_depl.nix_exprs = [os.path.abspath("./ebs-test.nix")]
test_depl.deploy(create_only=True)
test_depl.machines['machine'].run_command("nixos-version")
+
+if args.hvm:
+ image_type = 'hvm'
+else:
+ image_type = 'ebs'
+
+# Log the AMI ID.
+f = open("{0}.{1}.ami-id".format(args.region, image_type), "w")
+f.write("{0}".format(ami_id))
+f.close()
+
+for dest in [ 'us-east-1', 'us-west-1', 'us-west-2', 'eu-west-1']:
+ if args.region != dest:
+ print >> sys.stderr, "copying image from region {0} to {1}".format(args.region, dest)
+ conn = boto.ec2.connect_to_region(dest)
+ copy_image = conn.copy_image(args.region, ami_id, ami_name, description=None, client_token=None)
+
+ # Log the AMI ID.
+ f = open("{0}.{1}.ami-id".format(dest, image_type), "w")
+ f.write("{0}".format(copy_image.image_id))
+ f.close()
+
+
if not args.keep:
test_depl.destroy_resources()
test_depl.delete()
-# Log the AMI ID.
-f = open("{0}.ebs.ami-id".format(args.region), "w")
-f.write("{0}".format(ami_id))
-f.close()
diff --git a/maintainers/scripts/ec2/create-s3-amis.sh b/maintainers/scripts/ec2/create-s3-amis.sh
index 6608ebd51d60..1aaac2832394 100755
--- a/maintainers/scripts/ec2/create-s3-amis.sh
+++ b/maintainers/scripts/ec2/create-s3-amis.sh
@@ -1,7 +1,7 @@
#! /bin/sh -e
nixos=$(nix-instantiate --find-file nixos)
-export NIXOS_CONFIG=$nixos/modules/virtualisation/amazon-config.nix
+export NIXOS_CONFIG=$(dirname $(readlink -f $0))/amazon-base-config.nix
version=$(nix-instantiate --eval-only '' -A config.system.nixosVersion | sed s/'"'//g)
echo "NixOS version is $version"
diff --git a/modules/services/misc/nix-daemon.nix b/modules/services/misc/nix-daemon.nix
index 8f1bfd3ccaad..4563336a5bc7 100644
--- a/modules/services/misc/nix-daemon.nix
+++ b/modules/services/misc/nix-daemon.nix
@@ -54,7 +54,7 @@ in
options = {
environment.nix = mkOption {
- default = pkgs.nixUnstable;
+ default = pkgs.nix;
merge = mergeOneOption;
description = ''
This option specifies the Nix package instance to use throughout the system.
@@ -220,7 +220,7 @@ in
};
binaryCaches = mkOption {
- default = [ http://nixos.org/binary-cache ];
+ default = [ http://cache.nixos.org/ ];
type = types.listOf types.string;
description = ''
List of binary cache URLs used to obtain pre-built binaries
diff --git a/modules/services/monitoring/zabbix-server.nix b/modules/services/monitoring/zabbix-server.nix
index df42071ebba0..6735b4ca3279 100644
--- a/modules/services/monitoring/zabbix-server.nix
+++ b/modules/services/monitoring/zabbix-server.nix
@@ -34,6 +34,8 @@ let
''}
'';
+ useLocalPostgres = cfg.dbServer == "localhost" || cfg.dbServer == "";
+
in
{
@@ -51,7 +53,10 @@ in
services.zabbixServer.dbServer = mkOption {
default = "localhost";
- description = "Hostname or IP address of the database server.";
+ description = ''
+ Hostname or IP address of the database server.
+ Use an empty string ("") to use peer authentication.
+ '';
};
services.zabbixServer.dbPassword = mkOption {
@@ -65,7 +70,7 @@ in
config = mkIf cfg.enable {
- services.postgresql.enable = cfg.dbServer == "localhost";
+ services.postgresql.enable = useLocalPostgres;
users.extraUsers = singleton
{ name = "zabbix";
@@ -77,7 +82,7 @@ in
{ description = "Zabbix Server";
wantedBy = [ "multi-user.target" ];
- after = optional (cfg.dbServer == "localhost") "postgresql.service";
+ after = optional useLocalPostgres "postgresql.service";
preStart =
''
@@ -88,8 +93,8 @@ in
${pkgs.postgresql}/bin/createuser --no-superuser --no-createdb --no-createrole zabbix || true
${pkgs.postgresql}/bin/createdb --owner zabbix zabbix || true
cat ${pkgs.zabbix.server}/share/zabbix/db/schema/postgresql.sql | ${pkgs.su}/bin/su -s "$SHELL" zabbix -c '${pkgs.postgresql}/bin/psql zabbix'
- cat ${pkgs.zabbix.server}/share/zabbix/db/data/data.sql | ${pkgs.su}/bin/su -s "$SHELL" zabbix -c '${pkgs.postgresql}/bin/psql zabbix'
cat ${pkgs.zabbix.server}/share/zabbix/db/data/images_pgsql.sql | ${pkgs.su}/bin/su -s "$SHELL" zabbix -c '${pkgs.postgresql}/bin/psql zabbix'
+ cat ${pkgs.zabbix.server}/share/zabbix/db/data/data.sql | ${pkgs.su}/bin/su -s "$SHELL" zabbix -c '${pkgs.postgresql}/bin/psql zabbix'
touch "${libDir}/db-created"
fi
'';
@@ -100,6 +105,7 @@ in
serviceConfig.Type = "forking";
serviceConfig.Restart = "always";
serviceConfig.RestartSec = 2;
+ serviceConfig.PIDFile = pidFile;
};
};
diff --git a/modules/services/system/nscd.nix b/modules/services/system/nscd.nix
index 22f507f39d74..e8534b120435 100644
--- a/modules/services/system/nscd.nix
+++ b/modules/services/system/nscd.nix
@@ -52,6 +52,8 @@ in
mkdir -m 0755 -p /var/db/nscd
'';
+ restartTriggers = [ config.environment.etc.hosts.source ];
+
serviceConfig =
{ ExecStart = "@${pkgs.glibc}/sbin/nscd nscd -f ${./nscd.conf}";
Type = "forking";
diff --git a/modules/services/ttys/agetty.nix b/modules/services/ttys/agetty.nix
index f269de6fc2a0..850f558e4cb7 100644
--- a/modules/services/ttys/agetty.nix
+++ b/modules/services/ttys/agetty.nix
@@ -93,7 +93,7 @@ with pkgs.lib;
[Service]
Environment=TERM=linux
Environment=LOCALE_ARCHIVE=/run/current-system/sw/lib/locale/locale-archive
- ExecStart=@${pkgs.utillinux}/sbin/agetty agetty --login-program ${pkgs.shadow}/bin/login %I 115200,38400,9600
+ ExecStart=@${pkgs.utillinux}/sbin/agetty agetty --login-program ${pkgs.shadow}/bin/login %I 115200,57600,38400,9600
Type=idle
Restart=always
RestartSec=0
diff --git a/modules/services/web-servers/apache-httpd/zabbix.nix b/modules/services/web-servers/apache-httpd/zabbix.nix
index 6191d63584a9..a6e6042fdf6d 100644
--- a/modules/services/web-servers/apache-httpd/zabbix.nix
+++ b/modules/services/web-servers/apache-httpd/zabbix.nix
@@ -11,10 +11,11 @@ let
# we could generate zabbix.conf.php declaratively.
zabbixPHP = pkgs.runCommand "${pkgs.zabbix.server.name}-php" {}
''
- cp -rs ${pkgs.zabbix.server}/share/zabbix/php $out
+ cp -rs ${pkgs.zabbix.server}/share/zabbix/php "$out"
chmod -R u+w $out
- #rm -rf $out/conf
- ln -s ${config.stateDir}/zabbix.conf.php $out/conf/zabbix.conf.php
+ ln -s "${if config.configFile == null
+ then "${config.stateDir}/zabbix.conf.php"
+ else config.configFile}" "$out/conf/zabbix.conf.php"
'';
in
@@ -27,6 +28,7 @@ in
''
post_max_size = 32M
max_execution_time = 300
+ max_input_time = 300
'';
extraConfig = ''
@@ -57,6 +59,16 @@ in
";
};
+ configFile = pkgs.lib.mkOption {
+ default = null;
+ type = with pkgs.lib.types; nullOr path;
+ description = ''
+ The configuration file (zabbix.conf.php) which contains the database
+ connection settings. If not set, the configuration settings will created
+ by the web installer.
+ '';
+ };
+
stateDir = pkgs.lib.mkOption {
default = "/var/lib/zabbix/frontend";
description = "
diff --git a/tests/installer.nix b/tests/installer.nix
index 477e5c660af5..565f1d6a680b 100644
--- a/tests/installer.nix
+++ b/tests/installer.nix
@@ -75,7 +75,7 @@ let
{ services.httpd.enable = true;
services.httpd.adminAddr = "foo@example.org";
services.httpd.servedDirs = singleton
- { urlPath = "/binary-cache";
+ { urlPath = "/";
dir = "/tmp/channel";
};
@@ -123,7 +123,7 @@ let
# Allow the machine to talk to the fake nixos.org.
$machine->succeed(
"rm /etc/hosts",
- "echo 192.168.1.1 nixos.org > /etc/hosts",
+ "echo 192.168.1.1 nixos.org cache.nixos.org > /etc/hosts",
"ifconfig eth1 up 192.168.1.2",
);