diff --git a/modules/calibre-web/default.nix b/modules/calibre-web/default.nix index 80a5d23..062fa50 100644 --- a/modules/calibre-web/default.nix +++ b/modules/calibre-web/default.nix @@ -9,28 +9,36 @@ in { enable = lib.mkEnableOption "calibre-web"; }; - config = lib.mkIf cfg.enable { - services.calibre-web = { - enable = true; - listen.ip = "0.0.0.0"; - options = { - enableBookConversion = true; - enableBookUploading = true; - enableKepubify = true; + config = let + calibreLibraryPath = "/var/lib/calibre-library"; + in + lib.mkIf cfg.enable { + services.calibre-web = { + enable = true; + listen.ip = "0.0.0.0"; + options = { + enableBookConversion = true; + enableBookUploading = true; + enableKepubify = true; + calibreLibrary = calibreLibraryPath; + }; }; - }; - my.modules.https-proxy = { - configurations = [ - { - fqdn = "books.${config.my.host.name}.ritter.family"; - aliases = ["books.ritter.family"]; - target = "http://localhost:8083"; - extraConfig = '' - client_max_body_size 100M; - ''; - } + systemd.tmpfiles.rules = [ + "d ${calibreLibraryPath} 0755 calibre-web calibre-web" ]; + + my.modules.https-proxy = { + configurations = [ + { + fqdn = "books.${config.my.host.name}.ritter.family"; + aliases = ["books.ritter.family"]; + target = "http://localhost:8083"; + extraConfig = '' + client_max_body_size 100M; + ''; + } + ]; + }; }; - }; }