Merge remote-tracking branch 'prism/master'

This commit is contained in:
tv 2016-07-07 23:05:06 +02:00
commit f7d966043d
7 changed files with 46 additions and 37 deletions

View File

@ -3,13 +3,14 @@
with config.krebs.lib; with config.krebs.lib;
let let
nixpkgs-1509 = import (pkgs.fetchFromGitHub { # https://github.com/NixOS/nixpkgs/issues/14026
owner = "NixOS"; repo = "nixpkgs-channels"; nixpkgs-fix = import (pkgs.fetchgit {
rev = "91371c2bb6e20fc0df7a812332d99c38b21a2bda"; url = https://github.com/nixos/nixpkgs;
sha256 = "1as1i0j9d2n3iap9b471y4x01561r2s3vmjc5281qinirlr4al73"; rev = "e026b5c243ea39810826e68362718f5d703fb5d0";
sha256 = "87e0724910a6df0371f883f99a8cf42e366fb4119f676f6f74ffb404beca2632";
}) {}; }) {};
buildbot = nixpkgs-1509.buildbot; buildbot = nixpkgs-fix.buildbot;
buildbot-master-config = pkgs.writeText "buildbot-master.cfg" '' buildbot-master-config = pkgs.writeText "buildbot-master.cfg" ''
# -*- python -*- # -*- python -*-
from buildbot.plugins import * from buildbot.plugins import *

View File

@ -26,6 +26,9 @@ with builtins;
enable = true; enable = true;
}; };
} }
{
lass.power-action.battery = "BAT1";
}
]; ];
krebs.build.host = config.krebs.hosts.helios; krebs.build.host = config.krebs.hosts.helios;

View File

@ -3,6 +3,6 @@
{ {
krebs.build.source.nixpkgs = { krebs.build.source.nixpkgs = {
url = https://github.com/lassulus/nixpkgs; url = https://github.com/lassulus/nixpkgs;
rev = "c78f9ad2f91019648bdcf5a911f86ea3a397d290"; rev = "446d4c1fc10f53cf97abea1996d067ad93de2ded";
}; };
} }

View File

@ -113,18 +113,18 @@ in {
createHome = true; createHome = true;
}; };
services.phpfpm.phpOptions = '' #services.phpfpm.phpOptions = ''
extension=${pkgs.phpPackages.apcu}/lib/php/extensions/apcu.so # extension=${pkgs.phpPackages.apcu}/lib/php/extensions/apcu.so
sendmail_path = ${sendmail} -t # sendmail_path = ${sendmail} -t
'';
#services.phpfpm.phpIni = pkgs.runCommand "php.ini" {
# options = ''
# extension=${pkgs.phpPackages.apcu}/lib/php/extensions/apcu.so
# sendmail_path = "${sendmail} -t -i"
# '';
#} ''
# cat ${pkgs.php}/etc/php-recommended.ini > $out
# echo "$options" >> $out
#''; #'';
services.phpfpm.phpIni = pkgs.runCommand "php.ini" {
options = ''
extension=${pkgs.phpPackages.apcu}/lib/php/extensions/apcu.so
sendmail_path = "${sendmail} -t -i"
'';
} ''
cat ${pkgs.php}/etc/php-recommended.ini > $out
echo "$options" >> $out
'';
} }

View File

@ -74,18 +74,13 @@ in {
config.krebs.users.fritz.pubkey config.krebs.users.fritz.pubkey
]; ];
services.phpfpm.phpOptions = '' services.phpfpm.phpIni = pkgs.runCommand "php.ini" {
extension=${pkgs.phpPackages.apcu}/lib/php/extensions/apcu.so options = ''
sendmail_path = ${sendmail} -t extension=${pkgs.phpPackages.apcu}/lib/php/extensions/apcu.so
sendmail_path = "${sendmail} -t -i"
'';
} ''
cat ${pkgs.php}/etc/php-recommended.ini > $out
echo "$options" >> $out
''; '';
#services.phpfpm.phpIni = pkgs.runCommand "php.ini" {
# options = ''
# extension=${pkgs.phpPackages.apcu}/lib/php/extensions/apcu.so
# sendmail_path = "${sendmail} -t -i"
# '';
#} ''
# cat ${pkgs.php}/etc/php-recommended.ini > $out
# echo "$options" >> $out
#'';
} }

View File

@ -10,7 +10,7 @@ in toFile "ejabberd.conf" ''
[ [
{5222, ejabberd_c2s, [ {5222, ejabberd_c2s, [
starttls, starttls,
{certfile, ${toErlang cfg.certfile}}, {certfile, ${toErlang cfg.certfile.path}},
{access, c2s}, {access, c2s},
{shaper, c2s_shaper}, {shaper, c2s_shaper},
{max_stanza_size, 65536} {max_stanza_size, 65536}
@ -27,7 +27,7 @@ in toFile "ejabberd.conf" ''
]} ]}
]}. ]}.
{s2s_use_starttls, required}. {s2s_use_starttls, required}.
{s2s_certfile, ${toErlang cfg.s2s_certfile}}. {s2s_certfile, ${toErlang cfg.s2s_certfile.path}}.
{auth_method, internal}. {auth_method, internal}.
{shaper, normal, {maxrate, 1000}}. {shaper, normal, {maxrate, 1000}}.
{shaper, fast, {maxrate, 50000}}. {shaper, fast, {maxrate, 50000}}.

View File

@ -4,7 +4,12 @@ in {
options.lass.ejabberd = { options.lass.ejabberd = {
enable = mkEnableOption "lass.ejabberd"; enable = mkEnableOption "lass.ejabberd";
certfile = mkOption { certfile = mkOption {
type = types.str; type = types.secret-file;
default = {
path = "${cfg.user.home}/ejabberd.pem";
owner = cfg.user;
source-path = "/var/lib/acme/lassul.us/full.pem";
};
}; };
hosts = mkOption { hosts = mkOption {
type = with types; listOf str; type = with types; listOf str;
@ -17,12 +22,11 @@ in {
export EJABBERD_CONFIG_PATH=${shell.escape (import ./config.nix args)} export EJABBERD_CONFIG_PATH=${shell.escape (import ./config.nix args)}
exec ${pkgs.ejabberd}/bin/ejabberdctl \ exec ${pkgs.ejabberd}/bin/ejabberdctl \
--logs ${shell.escape cfg.user.home} \ --logs ${shell.escape cfg.user.home} \
--spool ${shell.escape cfg.user.home} \
"$@" "$@"
''; '';
}; };
s2s_certfile = mkOption { s2s_certfile = mkOption {
type = types.str; type = types.secret-file;
default = cfg.certfile; default = cfg.certfile;
}; };
user = mkOption { user = mkOption {
@ -36,9 +40,15 @@ in {
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
environment.systemPackages = [ cfg.pkgs.ejabberdctl ]; environment.systemPackages = [ cfg.pkgs.ejabberdctl ];
krebs.secret.files = {
ejabberd-certfile = cfg.certfile;
ejabberd-s2s_certfile = cfg.s2s_certfile;
};
systemd.services.ejabberd = { systemd.services.ejabberd = {
wantedBy = [ "multi-user.target" ]; wantedBy = [ "multi-user.target" ];
after = [ "network.target" ]; requires = [ "secret.service" ];
after = [ "network.target" "secret.service" ];
serviceConfig = { serviceConfig = {
Type = "oneshot"; Type = "oneshot";
RemainAfterExit = "yes"; RemainAfterExit = "yes";