feat: Expose website as a flake

This commit is contained in:
2022-05-14 17:23:19 +02:00
parent 110eea369b
commit eb018b6717
5 changed files with 126 additions and 2 deletions

37
pkgs/website.nix Normal file
View File

@@ -0,0 +1,37 @@
{
lib, stdenv
, python3
, shared-assets
}:
stdenv.mkDerivation {
pname = "website";
version = "202205120-01";
src = ../.;
buildInputs = [ shared-assets python3 ];
buildPhase = ''
${python3}/bin/python ${shared-assets}/bin/makesite.py \
-v page_assets=https://cdn.polynom.me \
--assets ./assets \
--copy-assets \
--include robots.txt \
-p params.json
'';
installPhase = ''
mkdir -p $out/srv/www/website
cp -vr _site/* $out/srv/www/website
'';
doCheck = false;
meta = with lib; {
description = "The website hosted at https://polynom.me";
homepage = "https://git.polynom.me/polynom.me/website";
maintainers = [];
license = licenses.gpl3;
};
}