./result/dist
folder:
λ nix build
λ nix run . watch
Listening on http://127.0.0.1:8000
...more logs
nix run .
!
λ nix run . clean
Removing dist...
Removing ssg/_cache...
Removing ssg/_tmp...
Start a development environment that
hakyll-site
(for building/watching/cleaning hakyll projects)hakyll-init
(for generating new projects)shell.buildInputs
of the
hakyllProject
in flake.nix
ghci
with some defaults and the modules loaded so you can
make your own changes and test them out in the ghci REPLλ nix develop
[hakyll-nix]λ hakyll-site build
...
Success
[hakyll-nix]λ ghci
...
[1 of 1] Compiling Main ( ssg/src/Main.hs, interpreted )
...
λ >
All of this is custmomizable, and here are some things that are already done for you:
slugger
module is included that makes nice link URIs based on post titlesConfigure the dev server, cache & tmp directories, and more in
./ssg/src/Main.hs
.
Deployment is set up through a GitHub
Action with cachix,
and it deploys to a GitHub Pages branch,
gh-pages
, when you merge code into your main branch.
Setup information can be found below in the "Cachix" section.
Note: If your main branch's name isn't main
, ensure 'refs/heads/main'
gets
updated to 'refs/heads/my-main-branch'
in ./github/workflows/main.yml
.
If you don't have nix, follow the nix installation instructions.
Once you have nix installed, follow the instructions here to get access to flakes: https://nixos.wiki/wiki/Flakes.
The ./.github/workflows/main.yml
file builds with help from
cachix, so you'll need to generate a signing key to be
able to do this.
CACHIX_SIGNING_KEY
secret on
https://github.com/settings/secrets