Merge pull request #251597 from wietsedv/calibre-web

nixos/calibre-web: add package and enableKepubify options
This commit is contained in:
Yorick 2023-09-20 22:35:16 +02:00 committed by GitHub
commit 829514e2da
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View file

@ -10,6 +10,8 @@ in
services.calibre-web = {
enable = mkEnableOption (lib.mdDoc "Calibre-Web");
package = lib.mkPackageOption pkgs "calibre-web" { };
listen = {
ip = mkOption {
type = types.str;
@ -73,6 +75,8 @@ in
'';
};
enableKepubify = mkEnableOption (lib.mdDoc "kebup conversion support");
enableBookUploading = mkOption {
type = types.bool;
default = false;
@ -106,7 +110,7 @@ in
systemd.services.calibre-web = let
appDb = "/var/lib/${cfg.dataDir}/app.db";
gdriveDb = "/var/lib/${cfg.dataDir}/gdrive.db";
calibreWebCmd = "${pkgs.calibre-web}/bin/calibre-web -p ${appDb} -g ${gdriveDb}";
calibreWebCmd = "${cfg.package}/bin/calibre-web -p ${appDb} -g ${gdriveDb}";
settings = concatStringsSep ", " (
[
@ -117,6 +121,7 @@ in
]
++ optional (cfg.options.calibreLibrary != null) "config_calibre_dir = '${cfg.options.calibreLibrary}'"
++ optional cfg.options.enableBookConversion "config_converterpath = '${pkgs.calibre}/bin/ebook-convert'"
++ optional cfg.options.enableKepubify "config_kepubifypath = '${pkgs.kepubify}/bin/kepubify'"
);
in
{

View file

@ -44,6 +44,7 @@ python.pkgs.buildPythonApplication rec {
flask-wtf
flask-limiter
iso-639
jsonschema
lxml
pypdf
requests