diff options
author | lassulus <lass@aidsballs.de> | 2015-12-30 17:16:05 +0100 |
---|---|---|
committer | lassulus <lass@aidsballs.de> | 2015-12-30 17:16:05 +0100 |
commit | 9b890750e24f43182ebf1732871a60d9e0c74c89 (patch) | |
tree | 4b3edf06c425b74d6209a3ea08d6ef1b48c2f15a /krebs/5pkgs/Reaktor/plugins.nix | |
parent | f16742895c26b0f3df71ca8503afc5f4cb97a9ae (diff) | |
parent | c625c7d422d5bfe6b4cdbafc6dd9eb0253673776 (diff) |
Merge remote-tracking branch 'gum/master'
Diffstat (limited to 'krebs/5pkgs/Reaktor/plugins.nix')
-rw-r--r-- | krebs/5pkgs/Reaktor/plugins.nix | 8 |
1 files changed, 5 insertions, 3 deletions
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>.*))?$$', |