nixos: services: add komga
All checks were successful
ci/woodpecker/push/check Pipeline was successful

This commit is contained in:
Bruno BELANYI 2024-09-30 22:10:38 +02:00
parent 79f08ea5a1
commit 09f763bc16
2 changed files with 56 additions and 0 deletions

View file

@ -16,6 +16,7 @@
./grocy ./grocy
./indexers ./indexers
./jellyfin ./jellyfin
./komga
./lohr ./lohr
./matrix ./matrix
./mealie ./mealie

View file

@ -0,0 +1,55 @@
# A Comics/Manga media server
{ config, lib, ... }:
let
cfg = config.my.services.komga;
in
{
options.my.services.komga = with lib; {
enable = mkEnableOption "Komga comics server";
port = mkOption {
type = types.port;
default = 4584;
example = 8080;
description = "Internal port for webui";
};
};
config = lib.mkIf cfg.enable {
services.komga = {
enable = true;
inherit (cfg) port;
group = "media";
};
systemd.services.komga.environment = {
LOGGING_LEVEL_ORG_GOTSON_KOMGA = "DEBUG"; # Needed for fail2ban
};
# Set-up media group
users.groups.media = { };
my.services.nginx.virtualHosts = {
komga = {
inherit (cfg) port;
};
};
services.fail2ban.jails = {
komga = ''
enabled = true
filter = komga
port = http,https
'';
};
environment.etc = {
"fail2ban/filter.d/komga.conf".text = ''
[Definition]
failregex = ^.* ip=<HOST>,.*Bad credentials.*$
journalmatch = _SYSTEMD_UNIT=komga.service
'';
};
};
}