nani.wtf/README.md

2.3 KiB

hakyll-nix-template

built with nix

Hakyll + Nix template

Features

tl;dr: nix-build will collect all your pinned dependencies, build your hakyll site, and output the built site in a result/ directory. If you set up the main GitHub Action with what it needs (your cachix cache, and your app needs a CACHIX_SIGNING_KEY secret), it will deploy your built site to a gh-pages branch.

  • Hakyll (see the generator folder)
    • Haskell nix-shell environment inside the generator folder through which you can run hakyll-site watch and all other hakyll commands, including the ability to run ghci and load haskell modules for testing
    • Ability to patch hakyll via hakyll.patch
    • Ability to provide nixpkgs overrides for packages whose versions need to come from hackage
    • RSS & Atom XML feed generation
    • Sitemap generation
    • Reasonable pandoc markdown customization to make it as close to GitHub's style as possible
    • Slug.hs module that makes nice URIs
    • Many other opinionated general website setup features that should be very helpful
  • Nix
    • Pinned nixpkgs, niv, and pre-commit-hooks.nix
    • nix-build will build your site into a result/ directory
    • nix-shell in the root will give you a shell with the tools dependencies in ./nix/default.nix
    • nix-shell in ./generator will give you a haskell shell with your hakyll-site available, as well as ghci
  • Dev linting via pre-commit-hooks.nix
  • Encourages dev use of lorri
  • Deployment through a GitHub Actions build with cachix and deploying to GitHub Pages via a gh-pages branch