my website
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

add autorebuild script

chfour 2a6bfdd5 b210ba7c

+23
+23
flake.nix
··· 85 85 text = builtins.readFile ./buildblog.sh; # eh? 86 86 }; 87 87 88 + packages.autorebuild = pkgs.writeShellApplication { 89 + name = "autorebuild"; 90 + runtimeInputs = with pkgs; [ selfPkgs.buildblog pkgs.inotify-tools ]; 91 + text = '' 92 + [ -z "''${1+x}" ] && echo "usage: $0 blog-dir" && exit 1 93 + 94 + rebuild() { 95 + time buildblog "$1" 96 + } 97 + rebuild "$@" 98 + last=$(date +%s) 99 + inotifywait -r -m "$1" \ 100 + -e modify -e create -e delete -e moved_to \ 101 + --excludei '/index.html|highlighting.css' \ 102 + | while read -r mod; do 103 + echo "$mod" 104 + now=$(date +%s) 105 + [ $((now - last)) -ge 1 ] && rebuild "$@" || echo '< 2s, skipping' 106 + last=$now 107 + done 108 + ''; 109 + }; 110 + 88 111 packages.website = pkgs.stdenvNoCC.mkDerivation { 89 112 name = "chfour-website"; 90 113