32 lines
753 B
Nix
32 lines
753 B
Nix
{ blog-source, pkgs, katex-html }:
|
|
|
|
with pkgs;
|
|
with lib;
|
|
|
|
let
|
|
protocol = ssl: if ssl then "https://" else "http://";
|
|
website = settings: stdenv.mkDerivation {
|
|
inherit (settings) src ssl host;
|
|
name = "blog-static";
|
|
version = settings.src.rev or "dirty";
|
|
publicPath = settings.path;
|
|
hugoFlags = concatStringsSep " " (
|
|
optionals settings.drafts (singleton "-D") ++
|
|
[ "--baseURL=${protocol settings.ssl + settings.host}" ]
|
|
);
|
|
builder = ./build/builder.sh;
|
|
buildInputs = [
|
|
hugo ruby stork katex-html
|
|
];
|
|
};
|
|
in
|
|
{
|
|
english = settings: website {
|
|
inherit (settings) host;
|
|
ssl = settings.ssl or false;
|
|
drafts = settings.drafts or false;
|
|
src = blog-source;
|
|
path = ".";
|
|
};
|
|
}
|