summaryrefslogtreecommitdiffstats
path: root/krebs
diff options
context:
space:
mode:
authorlassulus <lass@aidsballs.de>2015-12-30 17:16:05 +0100
committerlassulus <lass@aidsballs.de>2015-12-30 17:16:05 +0100
commit9b890750e24f43182ebf1732871a60d9e0c74c89 (patch)
tree4b3edf06c425b74d6209a3ea08d6ef1b48c2f15a /krebs
parentf16742895c26b0f3df71ca8503afc5f4cb97a9ae (diff)
parentc625c7d422d5bfe6b4cdbafc6dd9eb0253673776 (diff)
Merge remote-tracking branch 'gum/master'
Diffstat (limited to 'krebs')
-rw-r--r--krebs/3modules/Reaktor.nix11
-rw-r--r--krebs/3modules/exim-retiolum.nix20
-rw-r--r--krebs/5pkgs/Reaktor/plugins.nix8
3 files changed, 23 insertions, 16 deletions
diff --git a/krebs/3modules/Reaktor.nix b/krebs/3modules/Reaktor.nix
index 607eb7cac..92400139c 100644
--- a/krebs/3modules/Reaktor.nix
+++ b/krebs/3modules/Reaktor.nix
@@ -70,12 +70,17 @@ let
REAKTOR_HOST
REAKTOR_PORT
REAKTOR_STATEDIR
- REAKTOR_CHANNELS
debug and nickname can be set separately via the Reaktor api
'';
};
-
+ channels = mkOption {
+ default = [ "#krebs" ];
+ type = types.listOf types.str;
+ description = ''
+ Channels the Reaktor should connect to at startup.
+ '';
+ };
debug = mkOption {
default = false;
description = ''
@@ -112,7 +117,9 @@ let
GIT_SSL_CAINFO = "${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt";
REAKTOR_NICKNAME = cfg.nickname;
REAKTOR_DEBUG = (if cfg.debug then "True" else "False");
+ REAKTOR_CHANNELS = lib.concatStringsSep "," cfg.channels;
state_dir = cfg.workdir;
+
} // cfg.extraEnviron;
serviceConfig= {
ExecStartPre = pkgs.writeScript "Reaktor-init" ''
diff --git a/krebs/3modules/exim-retiolum.nix b/krebs/3modules/exim-retiolum.nix
index e1315d8c8..ea012c38c 100644
--- a/krebs/3modules/exim-retiolum.nix
+++ b/krebs/3modules/exim-retiolum.nix
@@ -1,14 +1,12 @@
{ config, pkgs, lib, ... }:
-with builtins;
with lib;
let
cfg = config.krebs.exim-retiolum;
out = {
options.krebs.exim-retiolum = api;
- config =
- mkIf cfg.enable imp;
+ config = mkIf cfg.enable imp;
};
api = {
@@ -16,13 +14,13 @@ let
};
imp = {
- services.exim =
- # This configuration makes only sense for retiolum-enabled hosts.
- # TODO modular configuration
- assert config.krebs.retiolum.enable;
- {
- enable = true;
- config = ''
+ services.exim = {
+ enable = true;
+ config =
+ # This configuration makes only sense for retiolum-enabled hosts.
+ # TODO modular configuration
+ assert config.krebs.retiolum.enable;
+ ''
primary_hostname = ${retiolumHostname}
domainlist local_domains = @ : localhost
domainlist relay_to_domains = *.retiolum
@@ -134,7 +132,7 @@ let
begin authenticators
'';
- };
+ };
};
# TODO get the hostname from somewhere else.
diff --git a/krebs/5pkgs/Reaktor/plugins.nix b/krebs/5pkgs/Reaktor/plugins.nix
index 5c7b89f5c..7490be4ca 100644
--- a/krebs/5pkgs/Reaktor/plugins.nix
+++ b/krebs/5pkgs/Reaktor/plugins.nix
@@ -14,6 +14,7 @@ rec {
buildSimpleReaktorPlugin = name: { script
, path ? []
, env ? {}
+ , append_rule ? false # append the rule instead of insert
, pattern ? ""
, ... } @ attrs:
let
@@ -26,7 +27,7 @@ rec {
});
src_file = "${src_dir}/bin/${name}";
config = ''
- public_commands.insert(0,{
+ public_commands.${if append_rule then "append(" else "insert(0," }{
'capname' : "${name}",
'pattern' : ${if pattern == "" then
''indirect_pattern.format("${name}")'' else
@@ -58,9 +59,10 @@ rec {
};
sed-plugin = buildSimpleReaktorPlugin "sed-plugin" {
- path = [ pkgs.gnused ];
+ path = [ pkgs.gnused pkgs.python3 ];
# only support s///gi the plugin needs to see every msg
# TODO: this will eat up the last regex, fix Reaktor to support fallthru
+ append_rule = true;
pattern = "^(?P<args>.*)$$";
script = ./scripts/sed-plugin.py;
};
@@ -105,7 +107,7 @@ rec {
config = ''
def titlebot_cmd(cmd):
from os import environ
- return { 'capname': cmd,
+ return { 'capname': None,
'env': { 'TITLEDB':
environ['state_dir']+'/suggestions.json' },
'pattern': '^\\.' + cmd + '\\s*(?:\\s+(?P<args>.*))?$$',