Skip to content

Instantly share code, notes, and snippets.

@patrl
Last active October 22, 2019 00:15
Show Gist options
  • Save patrl/86e2243fee2f129fa895933699e04f77 to your computer and use it in GitHub Desktop.
Save patrl/86e2243fee2f129fa895933699e04f77 to your computer and use it in GitHub Desktop.
Building a Hakyll blog on NixOS with stack

Getting stack to build my Hakyll sites on NixOS turned out to be non-trivial. Include the following files in the project directory.

{ pkgs ? import <nixpkgs> {}, ghc ? pkgs.ghc }:
pkgs.haskell.lib.buildStackProject {
name = "patrickdelliott.com";
inherit ghc;
buildInputs = with pkgs; [ zlib ];
LANG = "en_US.UTF-8";
TMPDIR = "/tmp";
}
# For more information, see: http://docs.haskellstack.org/en/stable/yaml_configuration.html
# Specifies the GHC version and set of packages available (e.g., lts-3.5, nightly-2015-09-21, ghc-7.10.2)
resolver: lts-9.12
# Local packages, usually specified by relative directory name
packages:
- '.'
# Packages to be pulled from upstream that are not in the resolver (e.g., acme-missiles-0.3)
extra-deps: []
# Override default flag values for local packages and extra-deps
flags: {}
# Extra package databases containing global packages
extra-package-dbs: []
# Control whether we use the GHC we find on the path
# system-ghc: true
# Require a specific version of stack, using version ranges
# require-stack-version: -any # Default
# require-stack-version: >= 1.0.0
# Override the architecture used by stack, especially useful on Windows
# arch: i386
# arch: x86_64
# Extra directories used by stack for building
# extra-include-dirs: [/path/to/dir]
# extra-lib-dirs: [/path/to/dir]
# Allow a newer minor version of GHC than the snapshot specifies
# compiler-check: newer-minor
nix:
enable: true
pure: true
shell-file: shell.nix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment