stockholm/lass/2configs/downloading.nix

75 lines
1.5 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
2015-10-30 23:10:43 +00:00
with lib;
2015-08-13 20:26:07 +00:00
{
imports = [
../3modules/folderPerms.nix
];
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-30 23:10:43 +00:00
openssh.authorizedKeys.keys = map readFile [
../../krebs/Zpubkeys/lass.ssh.pub
];
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";
#add rpc-password in secrets
rpc-password = "test123";
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
];
};
lass.folderPerms = {
enable = true;
permissions = [
{
path = "/var/download";
permission = "775";
owner = "transmission:download";
}
];
};
}