From 1d9211514cc1a61193f05c49e0efb8f19420a862 Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Sun, 2 Jun 2019 12:22:05 -0300 Subject: Update generated utils.nix --- utils.nix | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) (limited to 'utils.nix') diff --git a/utils.nix b/utils.nix index fd25021..f02db70 100644 --- a/utils.nix +++ b/utils.nix @@ -61,21 +61,16 @@ in rec { exit 1 ''; }); - orgMkDocs = title: + readmeCss = builtins.fetchurl { + url = "https://euandre.org/dotfiles/static/README.css"; + sha256 = "1r7ak92zsbhjm1qxz0r3dig0yxb41l43zl0yai63izha2s5r54d4"; + }; + readmeOrg = title: baseTask.overrideAttrs (baseAttrs: { - name = "${baseAttrs.name}-docs"; - buildInputs = [ pkgs.pandoc pkgs.mkdocs ]; + name = "${baseAttrs.name}-readme-docs"; + buildInputs = [ pkgs.pandoc ]; buildPhase = '' - # Convert from org-mode to markdown with pandoc - find docs/ -type f -name '*.org' -print0 | xargs -0 -I{} pandoc -o {}.md {}.org - - # Give the generated markdown files to MkDocs - mkdocs build - - # Build remaining one-off files - pandoc README.org -o site/index.html --css docs/README.css --to=html5 --self-contained --metadata title="${title}" - - mv site/ $out/ + pandoc README.org -o $out --css ${readmeCss} --to=html5 --self-contained --metadata title="${title}" ''; }); test = testDerivations: @@ -90,10 +85,11 @@ in rec { touch $out ''; }); - publishScript = docsDerivation: + overwritingPublishScript = { docsDerivation, overwrite ? true }: pkgs.writeShellScriptBin "publish.sh" '' set -euo pipefail OUT_DOCS="${docsDerivation}" + ${if overwrite then "# " else ""}${pkgs.openssh}/bin/ssh -o StrictHostKeyChecking=no "$SERVER_URL" rm -rf "$DOCS_SERVER_PATH/*" ${pkgs.rsync}/bin/rsync -avzP \ --rsh="ssh -o StrictHostKeyChecking=no" \ "$OUT_DOCS/" \ -- cgit v1.2.3