nix-packages/web/miifox-net.nix

35 lines
843 B
Nix
Raw Normal View History

2022-06-11 14:04:50 +00:00
{
2022-09-30 15:09:55 +00:00
stdenvNoCC,
fetchFromGitea,
chevron,
lndir,
lib,
}: let
source = builtins.fromJSON (builtins.readFile ./miifox.json);
in
stdenvNoCC.mkDerivation {
2022-06-11 14:04:50 +00:00
pname = "miifox.net";
2022-09-30 15:09:55 +00:00
version = source.date;
src = fetchFromGitea {
domain = "git.chir.rs";
owner = "CarolineHusky";
repo = "MiiFox.net";
inherit (source) rev sha256;
};
nativeBuildInputs = [chevron lndir];
2022-06-11 14:04:50 +00:00
buildPhase = ''
chevron -d index.json index.handlebars > index.html
'';
installPhase = ''
mkdir $out
2022-09-30 15:09:55 +00:00
lndir -silent $src $out
2022-06-11 14:04:50 +00:00
cp index.html $out
rm $out/index.json
'';
2022-09-30 15:09:55 +00:00
meta = {
description = "miifox.net";
license = lib.licenses.unfree;
};
passthru.updateScript = [../scripts/update-git.sh "https://git.chir.rs/CarolineHusky/MiiFox.net" "web/miifox.json"];
}