m 3 rtorrent: put rutorrent into separate package

This commit is contained in:
makefu 2016-08-24 17:31:15 +02:00
parent 0110192aaf
commit 2a31d1e069
3 changed files with 26 additions and 26 deletions

View file

@ -13,35 +13,14 @@ let
webdir = rucfg.webdir; webdir = rucfg.webdir;
systemd-logfile = cfg.workDir + "/rtorrent-systemd.log"; 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 ] ++ rutorrent-deps = with pkgs; [ curl php coreutils procps ffmpeg mediainfo ] ++
(if (config.nixpkgs.config.allowUnfree or false) then (if (config.nixpkgs.config.allowUnfree or false) then
trace "enabling unfree packages for rutorrent" [ unrar unzip ] else trace "enabling unfree packages for rutorrent" [ unrar unzip ] else
trace "not enabling unfree packages for rutorrent because allowUnfree is unset" []); 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" '' configFile = pkgs.writeText "rtorrent-config" ''
# THIS FILE IS AUTOGENERATED # THIS FILE IS AUTOGENERATED
${optionalString (cfg.listenPort != null) '' ${optionalString (cfg.listenPort != null) ''
@ -120,9 +99,9 @@ let
type = types.package; type = types.package;
description = '' description = ''
path to rutorrent package. When using your own ruTorrent package, 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} chmod -R 770 ${webdir}
else else
echo "not overwriting ${webdir}" echo "not overwriting ${webdir}"
fi 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"
''; '';
}; };
}; };

View file

@ -18,6 +18,7 @@ in
mycube-flask = callPackage ./mycube-flask {}; mycube-flask = callPackage ./mycube-flask {};
nodemcu-uploader = callPackage ./nodemcu-uploader {}; nodemcu-uploader = callPackage ./nodemcu-uploader {};
ps3netsrv = callPackage ./ps3netsrv {}; ps3netsrv = callPackage ./ps3netsrv {};
rutorrent = callPackage ./rutorrent {};
tw-upload-plugin = callPackage ./tw-upload-plugin {}; tw-upload-plugin = callPackage ./tw-upload-plugin {};
skytraq-logger = callPackage ./skytraq-logger {}; skytraq-logger = callPackage ./skytraq-logger {};
taskserver = callPackage ./taskserver {}; taskserver = callPackage ./taskserver {};

View file

@ -0,0 +1,15 @@
{ pkgs, ... }:
pkgs.stdenv.mkDerivation {
name = "rutorrent-src-3.7";
src = pkgs.fetchFromGitHub {
owner = "Novik";
repo = "rutorrent";
rev = "b727523a153454d4976f04b0c47336ae57cc50d5";
sha256 = "0s5wa0jnck781amln9c2p4pc0i5mq3j5693ra151lnwhz63aii4a";
};
phases = [ "installPhase" ];
installPhase = ''
cp -r $src $out
'';
}