stockholm/lass/2configs/downloading.nix

64 lines
1.3 KiB
Nix
Raw Normal View History

2015-10-30 23:10:43 +00:00
{ config, lib, pkgs, ... }:
2015-08-13 20:26:07 +00:00
2016-02-14 15:43:44 +00:00
with config.krebs.lib;
{
2015-08-13 20:26:07 +00:00
users.extraUsers = {
download = {
name = "download";
home = "/var/download";
createHome = true;
2015-10-30 23:10:43 +00:00
useDefaultShell = true;
2015-08-13 20:26:07 +00:00
extraGroups = [
"download"
];
openssh.authorizedKeys.keys = with config.krebs.users; [
lass.pubkey
lass-uriel.pubkey
lass-shodan.pubkey
makefu.pubkey
2015-10-30 23:10:43 +00:00
];
2015-08-13 20:26:07 +00:00
};
transmission = {
extraGroups = [
"download"
];
};
};
users.extraGroups = {
download = {
members = [
"download"
"transmission"
];
};
};
krebs.rtorrent = {
2015-08-13 20:26:07 +00:00
enable = true;
web = {
enable = true;
enableAuth = true;
listenAddress = "9091";
authfile = <secrets/torrent-authfile>;
2015-08-13 20:26:07 +00:00
};
rutorrent.enable = true;
enableXMLRPC = true;
listenPort = 51413;
downloadDir = "/var/download/finished";
# dump old torrents into watch folder to have them re-added
watchDir = "/var/download/watch";
2015-08-13 20:26:07 +00:00
};
2015-10-01 20:13:40 +00:00
krebs.iptables = {
2015-08-13 20:26:07 +00:00
enable = true;
tables.filter.INPUT.rules = [
{ predicate = "-p tcp --dport 9091"; target = "ACCEPT"; }
{ predicate = "-p tcp --dport 51413"; target = "ACCEPT"; }
{ predicate = "-p udp --dport 51413"; target = "ACCEPT"; }
2015-08-13 20:26:07 +00:00
];
};
}