{ 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}"; locations."/opds".proxyPass = "http://${cfg.listen.ip}:${toString cfg.listen.port}"; }; 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; enableBookUploading = true; }; }; }; }