nixos-config/hosts/challenger/services/calibre.nix

41 lines
981 B
Nix

{ config, lib, pkgs, ... }:
let
domain = "books.home.feal.no";
storage = "/tank/media/books";
cfg = config.services.calibre-web;
in {
services = {
nginx.virtualHosts.${domain} = {
locations = {
"/".proxyPass = "http://${cfg.listen.ip}:${toString cfg.listen.port}";
"/opds".proxyPass = "http://${cfg.listen.ip}:${toString cfg.listen.port}";
};
extraConfig = ''
client_max_body_size 512M;
proxy_busy_buffers_size 512k;
proxy_buffers 4 512k;
proxy_buffer_size 256k;
'';
};
calibre-server = {
enable = true;
user = "calibre-server";
libraries = [ storage ];
};
calibre-web = {
enable = true;
user = "calibre-server";
listen.ip = "127.0.0.1";
listen.port = 5010;
options = {
calibreLibrary = storage;
enableBookConversion = true;
enableKepubify = true;
enableBookUploading = true;
};
};
};
}