dotfiles/nix/home/programs/rtorrent/default.nix
2022-08-11 08:39:56 -07:00

34 lines
694 B
Nix

{ pkgs, finalDir, downloadDir, watchDir }:
let
dhtPort = 40000;
in
{
environment.systemPackages = with pkgs; [ rtorrent ];
users.extraUsers.rtorrent.extraGroups = [ "users" ];
services.rtorrent = {
enable = true;
downloadDir = downloadDir;
# flood needs to be able to access the datadir
dataDir = downloadDir;
configText =
builtins.readFile (pkgs.substituteAll {
src = ./rtorrent.rc;
watchDir = watchDir;
finalDir = finalDir;
dhtPort = builtins.toString dhtPort;
});
};
networking.firewall = {
allowedTCPPorts = [
# rtorrent default
50000
];
allowedUDPPorts = [
dhtPort
];
};
}