diff options
| author | aethrvmn <me@aethrvmn.gr> | 2025-11-30 21:59:43 +0000 |
|---|---|---|
| committer | aethrvmn <me@aethrvmn.gr> | 2025-11-30 21:59:43 +0000 |
| commit | 893ea11e1dc05fe1a2a34e66d4ebcfdffda34720 (patch) | |
| tree | ef454e299f49cbb58e1b9fbafd0b759b4379ac2a /modules/calibre | |
| parent | added .lock to ignorelist (diff) | |
huge restructure of modules
Diffstat (limited to 'modules/calibre')
| -rw-r--r-- | modules/calibre/default.nix | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/modules/calibre/default.nix b/modules/calibre/default.nix new file mode 100644 index 0000000..d177ac1 --- /dev/null +++ b/modules/calibre/default.nix @@ -0,0 +1,39 @@ +{ config, pkgs, ... }: +let + libDir = "/var/lib/calibre-web/library"; +in { + services = { + calibre-web = { + enable = true; + + listen = { + ip = "127.0.0.1"; + port = 3020; + }; + + options = { + calibreLibrary = libDir; + enableBookUploading = true; + }; + }; + + nginx = { + virtualHosts."library.internal" = { + locations."/" = { + proxyPass = "http://127.0.0.1:3020"; + proxyWebsockets = true; + }; + }; + }; + }; + + systemd.services.calibre-web = { + preStart = '' + if [ ! -f "${libDir}/metadata.db" ]; then + mkdir -p "${libDir}" + ${pkgs.calibre}/bin/calibredb add --empty \ + --with-library "${libDir}" + fi + ''; + }; +} |
