2
2
mirror of https://git.feal.no/felixalb/nixos-config.git synced 2024-12-23 12:37:30 +01:00
nixos-config/hosts/voyager/services/calibre.nix

34 lines
785 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}";
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;
};
};
};
}