From 643916762ec242c70486aee211a43c72550ae74a Mon Sep 17 00:00:00 2001 From: dadada Date: Thu, 31 Dec 2020 03:04:27 +0100 Subject: [PATCH] Extract build script --- build.sh | 3 +++ default.nix | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) create mode 100755 build.sh diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..95525f8 --- /dev/null +++ b/build.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +find . -iname "*.md" -type f -exec sh -c 'pandoc -s -f commonmark -t html --template src/template.html -o "''${0%.md}.html" "''${0}"' {} \; diff --git a/default.nix b/default.nix index 30cd1da..b7de4c6 100644 --- a/default.nix +++ b/default.nix @@ -1,13 +1,13 @@ { stdenv, pandoc }: stdenv.mkDerivation rec { - src = ./src; + src = ./.; nativeBuildInputs = [ pandoc ]; buildPhase = '' - find . -iname "*.md" -type f -exec sh -c 'pandoc -s -f commonmark -t html --template template.html -o "''${0%.md}.html" "''${0}"' {} \; + ./build.sh ''; installPhase = '' mkdir -p $out - cp -r . $out/ + cp -r src/* $out/ ''; name = "dadada.li"; version = "0.1";