website/pkgs/website.nix

45 lines
1.0 KiB
Nix
Raw Normal View History

2022-05-14 15:23:19 +00:00
{
lib, stdenv
, python3
, shared-assets
2023-07-17 15:01:11 +00:00
, tailwindWithTypography
}: let
pythonEnv = python3.withPackages (ps: with ps; [
markdown pygments
]);
in stdenv.mkDerivation {
2022-05-14 15:23:19 +00:00
pname = "website";
2023-07-17 15:01:11 +00:00
version = "20230716";
2022-05-14 15:23:19 +00:00
src = ../.;
buildInputs = [ shared-assets python3 ];
buildPhase = ''
2023-07-17 15:01:11 +00:00
${pythonEnv}/bin/python ${shared-assets}/bin/makesite.py \
2022-05-14 15:23:19 +00:00
-v page_assets=https://cdn.polynom.me \
--assets ./assets \
--copy-assets \
--include robots.txt \
-p params.json
2023-07-17 15:01:11 +00:00
# Build Tailwind CSS data
${tailwindWithTypography}/bin/tailwindcss --input ./input.css --output _site/assets/css/index.css
2022-05-14 15:23:19 +00:00
'';
installPhase = ''
mkdir -p $out/srv/www/website
cp -vr _site/* $out/srv/www/website
cp -vr well-known $out/srv/www/website/.well-known
2022-05-14 15:23:19 +00:00
'';
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;
};
}