Prelude
This is my first post. Hello, world!
In this post we are going to walk through my blog platform setup with Hakyll, Stack and Nix.
Some links you might want to explore beforehand:
- Hakyll Github Pages Tutorial by Hakyll’s author
- Hakyll’s Home Page
- Hakyll Presentation and demo by Hakyll’s author
- Nix/NixOS Homepage
- Github Pages Homepage
Intruduction
So this should be something similar to our end result: a place where to write your blog posts.
This post is basically just following this and turning on stack’s nix functionality.
This is desireable because non-haskell dependancies are solved in the case of adding any.
Steps
I am using NixOS 19.09 with stack 1.9.3 taken from the 19.03 channel
Follow this tutorial until you’ve hit
stack new myblog hakyll-templateUse
resolver: lts-12.26on stack.yamlThen append this to stack.yaml
nix: enable: true pure: true shell-file: shell.nixCreate
shell.nixwith this code, and change thenameto correspond to whatever name you want{ pkgs ? import <nixpkgs> {}, ghc ? pkgs.ghc }: pkgs.haskell.lib.buildStackProject { name = "blog.hhefesto.com"; inherit ghc; buildInputs = with pkgs; [ zlib haskellPackages.hakyll gmp # Any external dependancy you need may go here # search https://nixos.org/nixos/packages.html?channel=nixos-19.09 # for the dependancy you're looking for and just add it ]; LANG = "en_US.UTF-8"; TMPDIR = "/tmp"; }Continue jaspervdj’s tutorial