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

38 lines
708 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;
};
};
2024-11-28 22:46:25 +01:00
my.system.persist.directories = [
"/var/lib/flood"
];
# NOTE: unfortunately flood does not log connection failures for fail2ban
2021-05-22 22:45:05 +02:00
};
}