nixos-config/packages/web/miifox-net.nix

31 lines
747 B
Nix

{
stdenvNoCC,
fetchgit,
chevron,
lndir,
lib,
}: let
source = builtins.fromJSON (builtins.readFile ./miifox.json);
in
stdenvNoCC.mkDerivation {
pname = "miifox.net";
version = source.date;
src = fetchgit {
inherit (source) url rev sha256;
};
nativeBuildInputs = [chevron lndir];
buildPhase = ''
chevron -d index.json index.handlebars > index.html
'';
installPhase = ''
mkdir $out
lndir -silent $src $out
cp index.html $out
rm $out/index.json
'';
meta = {
description = "miifox.net";
license = lib.licenses.unfree;
};
passthru.updateScript = [../scripts/update-git.sh "https://git.chir.rs/CarolineHusky/MiiFox.net" "web/miifox.json"];
}