diff options
author | makefu <github@syntax-fehler.de> | 2016-08-24 17:31:15 +0200 |
---|---|---|
committer | makefu <github@syntax-fehler.de> | 2016-08-24 17:31:15 +0200 |
commit | 938e21973a1dc01375024f27d266d3bc6c413cd9 (patch) | |
tree | fa12532588ca864a61d039fc8a7886d809f026d6 /makefu/3modules | |
parent | b2815e98402c9983fa7174daa40bed6a8742e935 (diff) |
m 3 rtorrent: put rutorrent into separate package
Diffstat (limited to 'makefu/3modules')
-rw-r--r-- | makefu/3modules/rtorrent.nix | 36 |
1 files changed, 10 insertions, 26 deletions
diff --git a/makefu/3modules/rtorrent.nix b/makefu/3modules/rtorrent.nix index bdee90236..d6e22a08d 100644 --- a/makefu/3modules/rtorrent.nix +++ b/makefu/3modules/rtorrent.nix @@ -13,35 +13,14 @@ let webdir = rucfg.webdir; systemd-logfile = cfg.workDir + "/rtorrent-systemd.log"; - # must be in path of php-fpm and rtorrent when started ... + # rutorrent requires a couple of binaries to be available to either the + # rtorrent process or to phpfpm + rutorrent-deps = with pkgs; [ curl php coreutils procps ffmpeg mediainfo ] ++ (if (config.nixpkgs.config.allowUnfree or false) then trace "enabling unfree packages for rutorrent" [ unrar unzip ] else trace "not enabling unfree packages for rutorrent because allowUnfree is unset" []); - rutorrent = pkgs.stdenv.mkDerivation { - name = "rutorrent-src-3.7"; - src = pkgs.fetchFromGitHub { - owner = "Novik"; - repo = "rutorrent"; - rev = "b727523a153454d4976f04b0c47336ae57cc50d5"; - sha256 = "0s5wa0jnck781amln9c2p4pc0i5mq3j5693ra151lnwhz63aii4a"; - }; - - phases = [ "patchPhase" "installPhase" ]; - patchPhase = '' - cp -r $src src/ - chmod u+w -R src/ - sed -i -e 's#^\s*$scgi_port.*#$scgi_port = 0;#' \ - -e 's#^\s*$scgi_host.*#$scgi_host = "unix://${cfg.xmlrpc-socket}";#' \ - "src/conf/config.php" - ''; - installPhase = '' - cp -r src/ $out - echo "replacing scgi port and host variable in conf/config.php" - ''; - }; - configFile = pkgs.writeText "rtorrent-config" '' # THIS FILE IS AUTOGENERATED ${optionalString (cfg.listenPort != null) '' @@ -120,9 +99,9 @@ let type = types.package; description = '' path to rutorrent package. When using your own ruTorrent package, - make sure you patch the scgi_port and scgi_host. + scgi_port and scgi_host will be patched on startup. ''; - default = rutorrent; + default = pkgs.rutorrent; }; @@ -281,7 +260,12 @@ let chmod -R 770 ${webdir} else echo "not overwriting ${webdir}" + fi + echo "updating xmlrpc-socket with unix://${cfg.xmlrpc-socket}" + sed -i -e 's#^\s*$scgi_port.*#$scgi_port = 0;#' \ + -e 's#^\s*$scgi_host.*#$scgi_host = "unix://${cfg.xmlrpc-socket}";#' \ + "${webdir}/conf/config.php" ''; }; }; |