inspired by 7cf0d801d0
and also by https://www.krank.se/2014/06/25/rtorrent-magic-moving-finished-torrents-based-on-labels/
37 lines
663 B
Nix
37 lines
663 B
Nix
{ pkgs, ... }:
|
|
{
|
|
networking.firewall = {
|
|
allowedTCPPorts = [
|
|
#nginx
|
|
80
|
|
443
|
|
];
|
|
};
|
|
|
|
services.nginx = {
|
|
enable = true;
|
|
virtualHosts."torrents" = {
|
|
locations."/" = {
|
|
proxyPass = "http://localhost:3000";
|
|
};
|
|
};
|
|
};
|
|
|
|
users.extraUsers.flood = {
|
|
isNormalUser = true;
|
|
};
|
|
|
|
systemd.services = {
|
|
flood = {
|
|
enable = true;
|
|
serviceConfig = {
|
|
User = "flood";
|
|
WorkingDirectory = "/home/flood";
|
|
ExecStart = "${pkgs.flood}/bin/flood";
|
|
Restart = "on-failure";
|
|
};
|
|
wantedBy = [ "multi-user.target" ];
|
|
after = [ "network.target" ];
|
|
};
|
|
};
|
|
}
|