nix: create site build target

This commit is contained in:
Fiscal Velvet Poet 2021-11-16 14:33:25 +10:00
parent 20e4eabc65
commit f0e31569d9
Signed by: fiscalvelvetpoet
GPG key ID: D8EBFD58B023BD47

View file

@ -1 +1,22 @@
(import ./release.nix { }).project { nixpkgs ? import <nixpkgs> { }, compiler ? "default" }:
let
inherit (nixpkgs) pkgs;
haskellPackages = if compiler == "default" then
pkgs.haskellPackages
else
pkgs.haskell.packages.${compiler};
jfdic-org = haskellPackages.callPackage ./jfdic-org.nix { };
in nixpkgs.stdenv.mkDerivation {
name = "jfdic-org-website";
buildInputs = [ jfdic-org ];
src = ./.;
buildPhase = ''
echo "Setting LC_ALL to C.UTF-8 to avoid invalid byte sequence."
export LC_ALL=C.UTF-8
site build
'';
installPhase = ''
mkdir $out
cp -R _site/* $out
'';
}