nixos: services: add komga
All checks were successful
ci/woodpecker/push/check Pipeline was successful
All checks were successful
ci/woodpecker/push/check Pipeline was successful
This commit is contained in:
parent
79f08ea5a1
commit
09f763bc16
|
@ -16,6 +16,7 @@
|
||||||
./grocy
|
./grocy
|
||||||
./indexers
|
./indexers
|
||||||
./jellyfin
|
./jellyfin
|
||||||
|
./komga
|
||||||
./lohr
|
./lohr
|
||||||
./matrix
|
./matrix
|
||||||
./mealie
|
./mealie
|
||||||
|
|
55
modules/nixos/services/komga/default.nix
Normal file
55
modules/nixos/services/komga/default.nix
Normal 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
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in a new issue