stockholm/lass/2configs/downloading.nix

65 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;
let
rpc-password = import <secrets/transmission-pw>;
in {
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"
];
2015-10-31 14:09:43 +00:00
openssh.authorizedKeys.keys = [
config.krebs.users.lass.pubkey
config.krebs.users.lass-uriel.pubkey
2016-06-11 19:01:04 +00:00
config.krebs.users.lass-shodan.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"
];
};
};
services.transmission = {
enable = true;
settings = {
download-dir = "/var/download/finished";
incomplete-dir = "/var/download/incoming";
incomplete-dir-enabled = true;
rpc-authentication-required = true;
rpc-whitelist-enabled = false;
rpc-username = "download";
inherit rpc-password;
peer-port = 51413;
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
];
};
}