This commit is contained in:
martyTF 2026-05-13 23:58:57 +02:00
parent b11e8347c1
commit 5306a9a633
2 changed files with 50 additions and 0 deletions

View file

@ -8,6 +8,7 @@
{
imports = [
./jellyfin.nix
./kavita.nix
./navidrome.nix
];
}

View file

@ -0,0 +1,49 @@
{
config,
lib,
pkgs,
...
}:
{
options = {
server.media.kavita = {
enable = lib.mkEnableOption "enable kavita";
port = lib.mkOption {
default = 3812;
description = "kavita port";
};
public = lib.mkEnableOption "make kavita public";
subdomain = lib.mkOption {
default = "books";
description = "kavita subdomain";
};
};
};
config = {
services = {
kavita = {
enable = config.server.media.kavita.enable;
user = config.user.userName;
settings = {
Port = config.server.media.kavita.port;
};
};
nginx = {
virtualHosts = {
"${config.server.media.kavita.subdomain}.${config.networking.domain}" =
if config.server.media.kavita.public then
{
enableACME = true;
forceSSL = true;
locations."/" = {
proxyPass = "http://127.0.0.1:${toString config.server.media.kavita.port}";
};
}
else
{ };
};
};
};
};
}