9 python = python3.override {
11 packageOverrides = self: super: {
12 sqlalchemy = super.sqlalchemy_1_4;
16 python.pkgs.buildPythonApplication rec {
17 pname = "calibre-web";
20 src = fetchFromGitHub {
24 hash = "sha256-nWZmDasBH+DW/+Cvw510mOv11CXorRnoBwNFpoKPErY=";
27 propagatedBuildInputs = with python.pkgs; [
55 # default-logger.patch switches default logger to /dev/stdout. Otherwise calibre-web tries to open a file relative
56 # to its location, which can't be done as the store is read-only. Log file location can later be configured using UI
58 ./default-logger.patch
59 # DB migrations adds an env var __RUN_MIGRATIONS_ANDEXIT that, when set, instructs calibre-web to run DB migrations
60 # and exit. This is gonna be used to configure calibre-web declaratively, as most of its configuration parameters
61 # are stored in the DB.
65 # calibre-web doesn't follow setuptools directory structure.
67 mkdir -p src/calibreweb
68 mv cps.py src/calibreweb/__init__.py
71 substituteInPlace setup.cfg \
72 --replace-fail "cps = calibreweb:main" "calibre-web = calibreweb:main"
75 # Upstream repo doesn't provide any tests.
79 tests.calibre-web = nixosTests.calibre-web;
80 updateScript = nix-update-script { };
84 description = "Web app for browsing, reading and downloading eBooks stored in a Calibre database";
85 homepage = "https://github.com/janeczku/calibre-web";
86 license = licenses.gpl3Plus;
87 maintainers = with maintainers; [ pborzenkov ];
88 platforms = platforms.all;
89 mainProgram = "calibre-web";