summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2016-08-21 11:53:07 +0200
committermakefu <github@syntax-fehler.de>2016-08-21 11:53:07 +0200
commit75ff0e4937db594865379aa64f856fa7813d5cd5 (patch)
tree06c5f7c02e42f74237133652c8757ae97ea68690
parentccf521e4a46fed3b4e2075a4ace7b9ed382d4b82 (diff)
m 3 deluge: implement auth
-rw-r--r--makefu/3modules/deluge.nix11
1 files changed, 7 insertions, 4 deletions
diff --git a/makefu/3modules/deluge.nix b/makefu/3modules/deluge.nix
index 8097885b1..e81f96f85 100644
--- a/makefu/3modules/deluge.nix
+++ b/makefu/3modules/deluge.nix
@@ -5,12 +5,13 @@ with config.krebs.lib;
let
cfg_daemon = config.makefu.deluge;
homedir = cfg_daemon.homedir;
+ delugedir = "${homedir}/.config/deluge";
cfg_web = config.makefu.deluge.web;
core_conf = pkgs.writeText "deluge-core-cfg" ''
{
"file": 1,
"format": 1
- }${builtins.toJSON (recursiveUpdate default_core_cfg cfg_daemon.cfg)}
+ }${builtins.toJSON (default_core_cfg // cfg_daemon.cfg)}
'';
default_core_cfg = {
@@ -145,9 +146,11 @@ let
wantedBy = [ "multi-user.target" ];
serviceConfig = {
ExecStart = "${pkgs.pythonPackages.deluge}/bin/deluged -d";
- ExecStartPre = pkgs.writeDash "deluged-init" ''
- mkdir -p ${homedir}/.config/deluge
- cp ${core_conf} ${homedir}/.config/deluge/core.conf
+ ExecStartPre = let
+ in pkgs.writeDash "deluged-init" ''
+ mkdir -p ${delugedir}
+ echo ${shell.escape cfg_daemon.auth} > ${delugedir}/auth
+ cp -f ${core_conf} ${delugedir}/core.conf
'';
Restart = "on-success";
User = "deluge";