{ pkgs ? import { overlays = [ (overlayFinal: overlayPrev: let packageOverrides = (pythonFinal: pythonPrev: { apsw = pythonPrev.apsw.overridePythonAttrs (oldAttrs: { version = "3.38.1-r1"; src = overlayPrev.fetchFromGitHub { owner = "rogerbinns"; repo = "apsw"; rev = "3.38.1-r1"; sha256 = "sha256-pbb6wCu1T1mPlgoydB1Y1AKv+kToGkdVUjiom2vTqf4="; }; checkInputs = [ ]; # Project uses custom test setup to exclude some tests by default, so using pytest # requires more maintenance # https://github.com/rogerbinns/apsw/issues/335 checkPhase = '' python tests.py ''; pytestFlagsArray = [ ]; disabledTests = [ ]; }); }); python' = overlayPrev.python3.override { inherit packageOverrides; }; in { calibre = overlayPrev.calibre.override { python3Packages = python'.pkgs; }; }) ]; } }: let tex = with pkgs; texlive.combine { inherit (texlive) scheme-medium bitter titlesec; }; version = "devel"; in pkgs.stdenv.mkDerivation { pname = "tulpanomicon"; inherit version; src = ./.; phases = "buildPhase installPhase"; buildInputs = with pkgs; [ calibre mdbook pandoc tex ]; buildPhase = '' cp -rf $src/src . cp -rf $src/book.toml . mkdir book chmod -R a+w . mdbook build cd ./src && ./build.sh && cd .. ''; installPhase = '' mkdir -p $out cp -vrf book/* $out ''; }