m 3 rtorrent: put rutorrent into separate package
This commit is contained in:
parent
b2815e9840
commit
938e21973a
@ -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"
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
@ -18,6 +18,7 @@ in
|
||||
mycube-flask = callPackage ./mycube-flask {};
|
||||
nodemcu-uploader = callPackage ./nodemcu-uploader {};
|
||||
ps3netsrv = callPackage ./ps3netsrv {};
|
||||
rutorrent = callPackage ./rutorrent {};
|
||||
tw-upload-plugin = callPackage ./tw-upload-plugin {};
|
||||
skytraq-logger = callPackage ./skytraq-logger {};
|
||||
taskserver = callPackage ./taskserver {};
|
||||
|
15
makefu/5pkgs/rutorrent/default.nix
Normal file
15
makefu/5pkgs/rutorrent/default.nix
Normal 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
|
||||
'';
|
||||
}
|
Loading…
Reference in New Issue
Block a user