e425a657e691a04de7c8083c135dc48665b0424e
hakyll-nix-template
Usage
- Click the "Use this template" button and create your repository
- Renaming
- Rename all instances of
hakyll-nix-templatewith the name of your project - Rename
generator/hakyll-nix-template.cabalto reflect your project name - Cachix
- Create a cachix cache for your project on https://app.cachix.org
- Follow the cachix instructions to generate a signing keypair
- Copy the signing keypair value to a new
CACHIX_SIGNING_KEYsecret on https://github.com///settings/secrets - Run
nix-buildto build the project andnix-shellto open the nix shell - If you want to update
nivand the other pinned dependencies, then in thenix-shellrunniv initand thenniv updateand thenexitto leave the nix shell - To start an environment for running hakyll commands like
hakyll-site watch(the dev server) andhakyll-site build:cd generator && nix-shell. You'll then have access to thehakyll-siteexecutable defined ingenerator/hakyll-nix-template.cabal. While you can donix-shellin the root and thencd generator && hakyll-site watch, you get some more tools if younix-shellfrom within thegenerator/folder. - Once you're satisfied, create a branch, push your project up there, and check that the GitHub Actions successfully build. If so, you're good to merge your project with your main branch.
- Once you have a successful build on your main branch, open
https://github.com///settings and set the GitHub Pages
branch to be the
gh-pagesbranch
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-shellenvironment inside thegeneratorfolder through which you can runhakyll-site watchand all other hakyll commands, including the ability to runghciand 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.hsmodule that makes nice URIs- Many other opinionated general website setup features that should be very helpful
- Haskell
- Nix
- Pinned nixpkgs, niv, and pre-commit-hooks.nix
nix-buildwill build your site into aresult/directorynix-shellin the root will give you a shell with thetoolsdependencies in ./nix/default.nixnix-shellin ./generator will give you a haskell shell with yourhakyll-siteavailable, as well asghci
- 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-pagesbranch
Description
Languages
Haskell
54.8%
CSS
25%
HTML
15.9%
Nix
4.3%