summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortv <tv@shackspace.de>2015-09-25 01:27:19 +0200
committertv <tv@shackspace.de>2015-09-25 01:27:19 +0200
commit61b2d7c8cac8304b60defd36aa86ce73e1bcaf2c (patch)
treec155a1d0509fdbbc753ad5edead9f434636bbcb6
parent43692de77c8bd46e52b80fdf6102b6602c1bad56 (diff)
parentb88363ce1a4ecc420f2c7684c9c74949cd2b5db4 (diff)
Merge remote-tracking branch 'pnp/master'
-rw-r--r--makefu/1systems/pnp.nix2
-rw-r--r--makefu/2configs/Reaktor/stockholmLentil.nix9
-rw-r--r--makefu/2configs/Reaktor/titlebot.nix38
3 files changed, 47 insertions, 2 deletions
diff --git a/makefu/1systems/pnp.nix b/makefu/1systems/pnp.nix
index e70fb6179..2dce87d5d 100644
--- a/makefu/1systems/pnp.nix
+++ b/makefu/1systems/pnp.nix
@@ -22,6 +22,7 @@
## \/ are only plugins, must enable Reaktor explicitly
../2configs/Reaktor/stockholmLentil.nix
../2configs/Reaktor/simpleExtend.nix
+ ../2configs/Reaktor/titlebot.nix
../2configs/exim-retiolum.nix
../2configs/urlwatch.nix
@@ -29,6 +30,7 @@
# ../2configs/graphite-standalone.nix
];
krebs.Reaktor.enable = true;
+ krebs.Reaktor.debug = true;
krebs.build.host = config.krebs.hosts.pnp;
krebs.build.user = config.krebs.users.makefu;
diff --git a/makefu/2configs/Reaktor/stockholmLentil.nix b/makefu/2configs/Reaktor/stockholmLentil.nix
index 147fb5a7a..21f0305fb 100644
--- a/makefu/2configs/Reaktor/stockholmLentil.nix
+++ b/makefu/2configs/Reaktor/stockholmLentil.nix
@@ -2,7 +2,12 @@
with pkgs;
let
- random-issue = pkgs.writeScript "random-issue" (builtins.readFile ./random-issue.sh);
+ random-issue = pkgs.substituteAll( {
+ name="random-issue";
+ dir= "bin";
+ isExecutable=true;
+ src= ./random-issue.sh;
+ });
random-issue-path = lib.makeSearchPath "bin" (with pkgs; [
coreutils
git
@@ -14,7 +19,7 @@ in {
public_commands.insert(0,{
'capname' : "stockholm-issue",
'pattern' : indirect_pattern.format("stockholm-issue"),
- 'argv' : ["${random-issue}"],
+ 'argv' : ["${random-issue}/bin/random-issue"],
'env' : { 'state_dir': workdir,
'PATH':'${random-issue-path}',
'origin':'http://cgit.pnp/stockholm' } })
diff --git a/makefu/2configs/Reaktor/titlebot.nix b/makefu/2configs/Reaktor/titlebot.nix
new file mode 100644
index 000000000..9ef02548b
--- /dev/null
+++ b/makefu/2configs/Reaktor/titlebot.nix
@@ -0,0 +1,38 @@
+{ stdenv,config, lib, pkgs, ... }:
+
+with pkgs;
+let
+ pypkgs = pkgs.python3Packages;
+ titlebot_cmds = pypkgs.buildPythonPackage {
+ name = "titlebot_cmds";
+ propagatedBuildInputs = with pypkgs; [ setuptools ];
+ src = fetchurl {
+ # https://github.com/makefu/reaktor-titlebot tag 2.1.0
+ url = "https://github.com/makefu/reaktor-titlebot/archive/2.1.0.tar.gz";
+ sha256 = "0wvf09wmk8b52f9j65qrw81nwrhs9pfhijwrlkzp5l7l2q8cjkp6";
+ };
+ };
+ pub_cmds = ["up" "help" "list" "top" "highest" "undo" ];
+ priv_cmds = [ "clear" ];
+in {
+ # TODO: write identify file in
+ # {config.users.extraUsers.Reaktor.home}/state/admin.lst
+ krebs.Reaktor.extraConfig = ''
+ def titlebot_cmd(cmd):
+ return {
+ 'capname': cmd,
+ 'env': {
+ 'TITLEDB':
+ '${config.users.extraUsers.Reaktor.home}/suggestions.json'
+ },
+ 'pattern': '^\\.' + cmd + '\\s*(?:\\s+(?P<args>.*))?$$',
+ 'argv': [ '${titlebot_cmds}/bin/' + cmd ] }
+ # TODO: for each element in ${titlebot_cmds}/bin/*
+ public_commands.insert(0,titlebot_cmd('up'))
+ public_commands.insert(0,titlebot_cmd('help'))
+ public_commands.insert(0,titlebot_cmd('list'))
+ public_commands.insert(0,titlebot_cmd('top'))
+ public_commands.insert(0,titlebot_cmd('new'))
+ commands.insert(0,titlebot_cmd('clear'))
+ '';
+}