2022-12-10 04:09:21 -08:00
|
|
|
{ pkgs, ... }:
|
2022-09-18 15:13:50 -07:00
|
|
|
{
|
2022-12-10 04:09:21 -08:00
|
|
|
services.calibre-web = {
|
|
|
|
enable = true;
|
|
|
|
listen.port = 8083;
|
|
|
|
openFirewall = true;
|
|
|
|
# Bug in the module puts this in quotes in the systemd file
|
|
|
|
user = "calibre-server";
|
|
|
|
group = "calibre-server";
|
|
|
|
options = {
|
|
|
|
calibreLibrary = "/data/books";
|
|
|
|
enableBookUploading = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
users.users.calibre-server = {
|
|
|
|
isSystemUser = true;
|
|
|
|
group = "calibre-server";
|
|
|
|
};
|
2022-09-18 15:13:50 -07:00
|
|
|
|
|
|
|
services.calibre-server = {
|
|
|
|
enable = true;
|
|
|
|
libraries = [ "/data/books" ];
|
|
|
|
# Bug in the module puts this in quotes in the systemd file
|
|
|
|
# user = calibre;
|
|
|
|
# group = calibre;
|
|
|
|
};
|
|
|
|
|
2022-12-10 04:09:21 -08:00
|
|
|
environment.systemPackages = with pkgs; [ calibre ];
|
|
|
|
|
2022-09-18 15:13:50 -07:00
|
|
|
services.nginx.virtualHosts."books.mossnet.lan" = {
|
|
|
|
enableACME = false;
|
|
|
|
forceSSL = false;
|
|
|
|
|
|
|
|
locations."/" = {
|
|
|
|
extraConfig = ''
|
|
|
|
proxy_pass http://localhost:8083/;
|
|
|
|
proxy_set_header X-Forwarded-Host $host;
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
networking.firewall.allowedTCPPorts = [ 8080 ];
|
|
|
|
}
|