nixos-config/services/calibre-web.nix

45 lines
1 KiB
Nix
Raw Normal View History

2022-05-29 17:26:10 +02:00
{ config, pkgs, ... }:
2024-05-26 16:45:38 +02:00
let
port = 8088;
in
{
2022-09-04 11:23:15 +02:00
age.secrets.calibre-web-htpasswd = {
file = ../secrets/calibre-web/htpasswd.age;
owner = config.services.nginx.user;
};
2022-05-29 17:26:10 +02:00
services.calibre-web = {
enable = true;
2022-07-13 23:24:19 +02:00
group = "media";
2022-05-29 17:55:57 +02:00
listen.ip = "::1";
2022-05-29 17:26:10 +02:00
listen.port = port;
2022-05-29 17:55:57 +02:00
options.enableBookUploading = true;
options.enableBookConversion = true;
options.enableKepubify = true;
2022-05-29 17:26:10 +02:00
options.calibreLibrary = "/media/Books";
};
services.nginx = {
virtualHosts."books.felschr.com" = {
enableACME = true;
forceSSL = true;
2022-09-04 11:23:15 +02:00
locations = {
"/" = {
proxyPass = "http://[::1]:${toString port}";
extraConfig = ''
client_max_body_size 500M;
proxy_busy_buffers_size 1024k;
proxy_buffers 4 512k;
proxy_buffer_size 1024k;
2022-09-04 11:23:15 +02:00
'';
};
"/opds" = {
proxyPass = "http://[::1]:${toString port}";
basicAuthFile = config.age.secrets.calibre-web-htpasswd.path;
};
2022-05-29 17:55:57 +02:00
};
2022-05-29 17:26:10 +02:00
};
};
}