nix-config/modules/nixos/services/flood/default.nix

36 lines
666 B
Nix
Raw Normal View History

2021-05-22 22:45:05 +02:00
# A nice UI for various torrent clients
{ config, lib, ... }:
2021-05-22 22:45:05 +02:00
let
cfg = config.my.services.flood;
in
{
options.my.services.flood = with lib; {
enable = mkEnableOption "Flood UI";
port = mkOption {
type = types.port;
default = 9092;
example = 3000;
description = "Internal port for Flood UI";
};
};
config = lib.mkIf cfg.enable {
services.flood = {
enable = true;
2021-05-22 22:45:05 +02:00
inherit (cfg) port;
2021-05-22 22:45:05 +02:00
};
my.services.nginx.virtualHosts = {
flood = {
inherit (cfg) port;
};
};
# FIXME: persistence?
# NOTE: unfortunately flood does not log connection failures for fail2ban
2021-05-22 22:45:05 +02:00
};
}