stockholm/lass/2configs/downloading.nix

63 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-10-20 18:54:38 +00:00
with import <stockholm/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-shodan.pubkey
lass-icarus.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;
2016-12-26 13:18:43 +00:00
port = 9091;
basicAuth = import <secrets/torrent-auth>;
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
];
};
}