2020-09-22 04:03:52 +02:00
|
|
|
let
|
2020-11-02 18:28:23 +01:00
|
|
|
cfg = import ./nix/default.nix { };
|
2020-09-22 04:03:52 +02:00
|
|
|
in
|
|
|
|
{ pkgs ? cfg.pkgs }:
|
|
|
|
|
2020-11-02 18:28:23 +01:00
|
|
|
pkgs.stdenv.mkDerivation {
|
|
|
|
name = "hakyll-nix-template";
|
|
|
|
buildInputs = [
|
|
|
|
cfg.generator
|
|
|
|
];
|
|
|
|
src = cfg.src;
|
2020-09-22 04:03:52 +02:00
|
|
|
|
2020-11-02 18:28:23 +01:00
|
|
|
# https://github.com/jaspervdj/hakyll/issues/614
|
|
|
|
# https://github.com/NixOS/nix/issues/318#issuecomment-52986702
|
|
|
|
# https://github.com/MaxDaten/brutal-recipes/blob/source/default.nix#L24
|
|
|
|
LOCALE_ARCHIVE = pkgs.lib.optionalString (pkgs.buildPlatform.libc == "glibc") "${pkgs.glibcLocales}/lib/locale/locale-archive";
|
|
|
|
LANG = "en_US.UTF-8";
|
2020-09-22 04:03:52 +02:00
|
|
|
|
2020-11-02 18:28:23 +01:00
|
|
|
buildPhase = ''
|
|
|
|
hakyll-site build
|
|
|
|
'';
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p "$out/dist"
|
|
|
|
cp -r ../dist/* "$out/dist"
|
|
|
|
'';
|
|
|
|
}
|