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

35 lines
786 B
Nix
Raw Normal View History

2023-06-09 22:34:46 +02:00
{ 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;
};
};
};
}