{ flake.modules.homeManager.base = { pkgs, ... }: { home.packages = [ (pkgs.writeShellApplication { name = "build-adoc"; runtimeInputs = with pkgs; [ asciidoctor-with-extensions ]; excludeShellChecks = [ "SC2034" ]; text = '' ls book echo "" date=$(date '+%Y-%m-%d %H:%M:%S') echo "The current date is $date." pwd=$(pwd) parent=$(basename "$(dirname "$pwd")") name=$(basename "$pwd") echo "The parent directory is $parent." echo "The current directory is $name." echo "" echo "Generating the HTML..." asciidoctor \ -D book \ -a "date=$date" \ -o index.html \ ./book/index.adoc echo "" echo "Generating the EPUB..." asciidoctor-epub3 \ -D book \ -a "date=$date" \ -o "$parent-$name.epub" \ ./book/index.adoc echo "" echo "Generating the PDF..." asciidoctor-pdf \ -D book \ -a "date=$date" \ -o "$parent-$name.pdf" \ ./book/index.adoc echo "" ls book ''; }) ]; }; }