{ pkgs ? import { } }: let nur = import (builtins.fetchTarball "https://github.com/nix-community/NUR/archive/master.tar.gz") { inherit pkgs; }; tex = pkgs.callPackage ../nix/texlive.nix { }; version = "devel"; words = import ../words; in pkgs.stdenv.mkDerivation { pname = "lewa-book"; inherit version; src = ./.; phases = "buildPhase installPhase"; buildInputs = with pkgs; [ calibre mdbook nur.repos.mic92.pandoc-bin tex words ]; buildPhase = '' cp -rf $src/src . chmod a+w ./src cp -rf $src/book.toml . mkdir book rm ./src/dictionary.md ||: cp ${words}/dictionary.md ./src/dictionary.md mdbook build cd ./src && ./build.sh && cd .. cd ./book && ebook-convert lewa.epub lewa.mobi ||: && cd .. ''; installPhase = '' mkdir -p $out cp -rf book $out/book ''; }