{ pkgs ? import {} # source of the site's files , src ? ./defaultsite # source of the hakyll script; will default # to the site's source if set to null (default). , hakyllSrc ? null # name for the site's derivation , name ? "hakyll-site" # plug some other compiler in here if you want , compiler ? "default" }: with pkgs; let f = import ./default.nix (if hakyllSrc == null then src else hakyllSrc); haskellPackages = if compiler == "default" then pkgs.haskellPackages else pkgs.haskell.packages.${compiler}; hakyll = haskellPackages.callPackage f {}; in stdenv.mkDerivation { inherit src name; # haskell reads in files with the character encoding # declared in an environment file; nix does not set this # by default, causing hakyll to fail on files containing # unicode. LC_ALL = "C.UTF-8"; buildInputs = [ hakyll ]; buildPhase = '' ${hakyll}/bin/site build ''; installPhase = '' mkdir $out cp -r _site/* $out ''; }