diff options
author | makefu <github@syntax-fehler.de> | 2017-07-28 23:06:40 +0200 |
---|---|---|
committer | makefu <github@syntax-fehler.de> | 2017-07-28 23:06:40 +0200 |
commit | 9884b522fe922a1f20cc1217ece0e79a49a64e92 (patch) | |
tree | 279c9f0e3fccb3e225169025546935c796c5d335 /krebs | |
parent | b28d64255a9d61f89e375dc8f6d39e1c34aa6900 (diff) |
Reaktor: introduce <botname>.workdir
Diffstat (limited to 'krebs')
-rw-r--r-- | krebs/3modules/Reaktor.nix | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/krebs/3modules/Reaktor.nix b/krebs/3modules/Reaktor.nix index a70f1ef5d..99a7a55ef 100644 --- a/krebs/3modules/Reaktor.nix +++ b/krebs/3modules/Reaktor.nix @@ -4,8 +4,7 @@ with import <stockholm/lib>; let cfg = config.krebs.Reaktor; - - workdir = "/var/lib/Reaktor"; + homedir = "/var/lib/Reaktor"; out = { options.krebs.Reaktor = api; @@ -38,6 +37,14 @@ let default = [pkgs.ReaktorPlugins.nixos-version]; }; + workdir = mkOption { + default = "/var/lib/Reaktor"; + type = types.path; + description = '' + path to be used as workdir (home dir is still /var/lib/Reaktor) + ''; + }; + extraConfig = mkOption { default = ""; type = types.string; @@ -84,7 +91,7 @@ let name = "Reaktor"; uid = genid name; description = "Reaktor user"; - home = workdir; + home = homedir; createHome = true; }; @@ -118,7 +125,7 @@ let REAKTOR_NICKNAME = botcfg.nickname; REAKTOR_DEBUG = (if botcfg.debug then "True" else "False"); REAKTOR_CHANNELS = lib.concatStringsSep "," botcfg.channels; - state_dir = workdir; + state_dir = botcfg.workdir; } // botcfg.extraEnviron; serviceConfig= { @@ -129,6 +136,7 @@ let else ''(${pkgs.Reaktor}/bin/reaktor get-config;cat "${ReaktorConfig}" ) > /tmp/reaktor-${name}-config.py'' } + mkdir -p ${botcfg.workdir} ''; ExecStart = "${pkgs.Reaktor}/bin/reaktor run /tmp/reaktor-${name}-config.py"; PrivateTmp = "true"; |