nixos-config/machines/renge/services/sbruder.xyz/default.nix
2023-05-06 11:39:31 +02:00

54 lines
1,004 B
Nix

{ config, pkgs, ... }:
{
imports = [
./blocks.nix
];
services.nginx.virtualHosts."sbruder.xyz" = {
root = pkgs.stdenvNoCC.mkDerivation {
name = "sbruder.xyz";
src = ./.;
nativeBuildInputs = with pkgs; [ pandoc ];
buildPhase = ''
runHook preBuild
pandoc \
-s \
--metadata-file metadata.yaml \
-f commonmark_x \
-t html5 \
-o index.html \
index.md
runHook postBuild
'';
installPhase = ''
runHook preInstall
install -D index.html $out/index.html
runHook postInstall
'';
};
extraConfig = ''
allow ${config.sbruder.wireguard.home.subnet};
deny all;
'';
locations = {
"/imprint/".alias = "${pkgs.sbruder.imprint}/";
"/transparency/" = {
alias = "${./transparency}/";
extraConfig = ''
autoindex on;
charset utf-8;
'';
};
};
};
}