dotfiles/nix/home/programs/flood/default.nix
2022-08-11 08:39:56 -07:00

39 lines
761 B
Nix

{ pkgs, ... }:
{
networking.firewall = {
allowedTCPPorts = [
#nginx
80
443
];
};
services.nginx = {
enable = true;
virtualHosts."torrents" = {
locations."/" = {
proxyPass = "http://localhost:3000";
};
};
};
users.users.flood.group = "flood";
users.extraUsers.flood = {
isNormalUser = true;
extraGroups = [ "rtorrent" "users" ];
};
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" "rtorrent.service" ];
};
};
}