Update readme and change bobProject to hakyllProject

This commit is contained in:
Robert W. Pearce 2023-01-28 19:15:09 +13:00
parent 0a2af0dc89
commit 123bd7ca92
No known key found for this signature in database
GPG key ID: 8EE70FB52D805C55
2 changed files with 14 additions and 13 deletions

View file

@ -2,24 +2,25 @@
[Hakyll](https://jaspervdj.be/hakyll/) + [Nix](https://nixos.org) template [Hakyll](https://jaspervdj.be/hakyll/) + [Nix](https://nixos.org) template
[![built with nix](https://builtwithnix.org/badge.svg)](https://builtwithnix.org)
## Features ## Features
### nix flakes * Can be ran with Nix or through a [Docker](https://www.docker.com) container
running Nix. If you're using Docker, then prefix your commands like `docker
compose run --rm app nix build`, and if you just want to start the hakyll dev
server, all you need to run is `docker-compose build` and then `docker-compose
up`
* Build your site into the `./result/dist` folder: * Build your site into the `./result/dist` folder:
```sh ```
λ nix build λ nix build
``` ```
* Start hakyll's dev server that reloads when changes are made: * Start hakyll's dev server that reloads when changes are made:
```sh ```
λ nix run . watch λ nix run . watch
Listening on http://127.0.0.1:8000 Listening on http://127.0.0.1:8000
...more logs ...more logs
``` ```
* Run any hakyll command through `nix run .`! * Run any hakyll command through `nix run .`!
```sh ```
λ nix run . clean λ nix run . clean
Removing dist... Removing dist...
Removing ssg/_cache... Removing ssg/_cache...
@ -29,12 +30,12 @@
* has your shell environment * has your shell environment
* has `hakyll-site` (for building/watching/cleaning hakyll projects) * has `hakyll-site` (for building/watching/cleaning hakyll projects)
* has `hakyll-init` (for generating new projects) * has `hakyll-init` (for generating new projects)
* can have anything else you put in the `buildInputs` of the `devShell` in * can have anything else you put in the `shell.buildInputs` of the
`flake.nix`; for example: `haskell-language-server`, `hlint`, and `ormolu` `hakyllProject` in `flake.nix`
* is set up to run `ghci` with some defaults and the modules loaded so you can * is set up to run `ghci` with some defaults and the modules loaded so you can
make your own changes and test them out in the ghci REPL make your own changes and test them out in the ghci REPL
```sh ```
λ nix develop λ nix develop
[hakyll]λ hakyll-site build [hakyll]λ hakyll-site build
@ -79,7 +80,7 @@ updated to `'refs/heads/my-main-branch'` in `./github/workflows/main.yml`.
## Setup ## Setup
### Nix Flakes ### Nix & Flakes
If you don't have [nix](https://nixos.org), follow [the nix installation If you don't have [nix](https://nixos.org), follow [the nix installation
instructions](https://nixos.org/download.html). instructions](https://nixos.org/download.html).

View file

@ -23,7 +23,7 @@
let let
overlays = [ haskellNix.overlay overlays = [ haskellNix.overlay
(final: prev: { (final: prev: {
bobProject = final.haskell-nix.project' { hakyllProject = final.haskell-nix.project' {
src = ./ssg; src = ./ssg;
compiler-nix-name = "ghc925"; compiler-nix-name = "ghc925";
shell.buildInputs = [ shell.buildInputs = [
@ -43,7 +43,7 @@
inherit (haskellNix) config; inherit (haskellNix) config;
}; };
flake = pkgs.bobProject.flake {}; flake = pkgs.hakyllProject.flake {};
executable = "ssg:exe:hakyll-site"; executable = "ssg:exe:hakyll-site";