Add torrent service
This commit is contained in:
parent
32c4ebad26
commit
5d2c02b331
6 changed files with 87 additions and 0 deletions
|
|
@ -16,6 +16,7 @@ let
|
|||
"rpool/nixos/home" = "/home";
|
||||
"rpool/nixos/var/lib" = "/var/lib";
|
||||
"rpool/nixos/var/log" = "/var/log";
|
||||
"rpool/sturzbach" = "/sturzbach";
|
||||
};
|
||||
partitionScheme = {
|
||||
efiBoot = "-part1";
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
{
|
||||
imports = [
|
||||
./dnsmasq.nix
|
||||
./nginx.nix
|
||||
./torrent.nix
|
||||
./unifi-controller.nix
|
||||
];
|
||||
}
|
||||
|
|
|
|||
15
hosts/iron/services/nginx.nix
Normal file
15
hosts/iron/services/nginx.nix
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
{ pkgs, ... }:
|
||||
{
|
||||
services.nginx = {
|
||||
enable = true;
|
||||
recommendedGzipSettings = true;
|
||||
recommendedOptimisation = true;
|
||||
recommendedProxySettings = true;
|
||||
recommendedTlsSettings = true;
|
||||
};
|
||||
networking.firewall.interfaces."enp3s4".allowedTCPPorts = [
|
||||
#networking.firewall.allowedTCPPorts = [
|
||||
80
|
||||
443
|
||||
];
|
||||
}
|
||||
39
hosts/iron/services/torrent.nix
Normal file
39
hosts/iron/services/torrent.nix
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
{ lib, pkgs, ... }:
|
||||
let
|
||||
aria2RpcPort = 6800;
|
||||
aria2ListenPort = 59832;
|
||||
in
|
||||
{
|
||||
services.aria2 = {
|
||||
enable = true;
|
||||
rpcListenPort = aria2RpcPort;
|
||||
extraArguments = lib.concatStringsSep " " [
|
||||
"--auto-save-interval=60"
|
||||
"--bt-hash-check-seed=true"
|
||||
"--bt-max-peers=0"
|
||||
"--bt-save-metadata=true"
|
||||
"--check-integrity=true"
|
||||
"--continue=true"
|
||||
"--force-save=true"
|
||||
"--input-file /var/lib/aria2/aria2.session"
|
||||
"--max-concurrent-downloads=1000"
|
||||
"--rpc-allow-origin-all=true"
|
||||
"--rpc-listen-all"
|
||||
"--seed-ratio=0.0"
|
||||
];
|
||||
listenPortRange = [
|
||||
{
|
||||
from = aria2ListenPort;
|
||||
to = aria2ListenPort;
|
||||
}
|
||||
];
|
||||
downloadDir = "/sturzbach";
|
||||
};
|
||||
networking.firewall = {
|
||||
allowedTCPPorts = [ aria2ListenPort ];
|
||||
interfaces."enp3s4".allowedTCPPorts = [ aria2RpcPort ];
|
||||
};
|
||||
services.nginx.virtualHosts."iron.bw.lan.jalr.de" = {
|
||||
root = pkgs.ariang;
|
||||
};
|
||||
}
|
||||
29
pkgs/ariang/default.nix
Normal file
29
pkgs/ariang/default.nix
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
{ lib
|
||||
, stdenvNoCC
|
||||
, fetchurl
|
||||
, unzip
|
||||
, pkgs
|
||||
}:
|
||||
|
||||
stdenvNoCC.mkDerivation rec {
|
||||
pname = "ariang";
|
||||
version = "1.3.4";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://github.com/mayswind/AriaNg/releases/download/${version}/AriaNg-${version}.zip";
|
||||
sha256 = "sha256-HYKPbDWOO531LXm4a0XZ3ZjzGom1ZbbkwyyBbp7Dduw=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ unzip ];
|
||||
|
||||
unpackPhase = ''
|
||||
unpackFile $src
|
||||
'';
|
||||
|
||||
dontBuild = true;
|
||||
|
||||
installPhase = ''
|
||||
mkdir $out
|
||||
cp -r * $out
|
||||
'';
|
||||
}
|
||||
|
|
@ -3,6 +3,7 @@ let
|
|||
inherit (prev) callPackage;
|
||||
in
|
||||
{
|
||||
ariang = callPackage ./ariang { };
|
||||
fpvout = callPackage ./fpvout { };
|
||||
mute-indicator = callPackage ./mute-indicator { };
|
||||
pretix = callPackage ./pretix/pretix.nix { };
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue