nixos-config/services/calibre-web.nix

39 lines
898 B
Nix
Raw Normal View History

2022-05-29 17:26:10 +02:00
{ config, pkgs, ... }:
let port = 8088;
2022-05-29 17:26:10 +02:00
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;
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;
'';
};
"/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
};
};
}