summaryrefslogtreecommitdiffstats
path: root/krebs/3modules/Reaktor.nix
diff options
context:
space:
mode:
authortv <tv@shackspace.de>2015-10-01 17:16:57 +0200
committertv <tv@shackspace.de>2015-10-01 17:16:57 +0200
commitcd61f94ba02c485327547ace8cd28a22e38bfe0f (patch)
treeeb3ace527780b9e5b66cb7517e9bee6a61bd8e66 /krebs/3modules/Reaktor.nix
parent24326956780833540fd65dd0cb750c1071fa51b9 (diff)
parentd9f4d621bcde5ddc983a922e378657dba1f6e141 (diff)
Merge remote-tracking branch 'pnp/master'
Diffstat (limited to 'krebs/3modules/Reaktor.nix')
-rw-r--r--krebs/3modules/Reaktor.nix25
1 files changed, 15 insertions, 10 deletions
diff --git a/krebs/3modules/Reaktor.nix b/krebs/3modules/Reaktor.nix
index fce24fa63..82089a660 100644
--- a/krebs/3modules/Reaktor.nix
+++ b/krebs/3modules/Reaktor.nix
@@ -2,7 +2,6 @@
let
- kpkgs = import ../5pkgs { inherit pkgs; inherit lib; };
inherit (lib)
mkIf
@@ -63,13 +62,20 @@ let
configuration appended to the default or overridden configuration
'';
};
-
- ReaktorPkg = mkOption {
- default = kpkgs.Reaktor;
+ extraEnviron = mkOption {
+ default = {};
+ type = types.attrsOf types.str;
description = ''
- the Reaktor pkg to use.
+ Environment to be provided to the service, can be:
+ REAKTOR_HOST
+ REAKTOR_PORT
+ REAKTOR_STATEDIR
+ REAKTOR_CHANNELS
+
+ debug and nickname can be set separately via the Reaktor api
'';
};
+
debug = mkOption {
default = false;
description = ''
@@ -80,7 +86,6 @@ let
imp = {
# for reaktor get-config
- environment.systemPackages = [ cfg.ReaktorPkg ];
users.extraUsers = singleton {
name = "Reaktor";
# uid = config.ids.uids.Reaktor;
@@ -98,7 +103,7 @@ let
systemd.services.Reaktor = {
path = with pkgs; [
utillinux #flock for tell_on-join
- # git # for nag
+ git # for nag
python # for caps
];
description = "Reaktor IRC Bot";
@@ -108,17 +113,17 @@ 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");
- };
+ } // cfg.extraEnviron;
serviceConfig= {
ExecStartPre = pkgs.writeScript "Reaktor-init" ''
#! /bin/sh
${if (isString cfg.overrideConfig) then
''cp ${ReaktorConfig} /tmp/config.py''
else
- ''(${cfg.ReaktorPkg}/bin/reaktor get-config;cat "${ReaktorConfig}" ) > /tmp/config.py''
+ ''(${pkgs.Reaktor}/bin/reaktor get-config;cat "${ReaktorConfig}" ) > /tmp/config.py''
}
'';
- ExecStart = "${cfg.ReaktorPkg}/bin/reaktor run /tmp/config.py";
+ ExecStart = "${pkgs.Reaktor}/bin/reaktor run /tmp/config.py";
PrivateTmp = "true";
User = "Reaktor";
Restart = "on-abort";