2024-01-06 01:19:35 +01:00
|
|
|
# SPDX-FileCopyrightText: 2021-2024 Simon Bruder <simon@sbruder.de>
|
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
|
|
|
|
2023-05-06 10:54:03 +02:00
|
|
|
{ config, pkgs, ... }:
|
2023-12-31 17:08:50 +01:00
|
|
|
let
|
|
|
|
goneVhost = {
|
|
|
|
locations."~ .*".return = "303 'https://sbruder.xyz/#history'";
|
|
|
|
};
|
|
|
|
in
|
2021-09-08 18:23:21 +02:00
|
|
|
{
|
2023-04-29 09:41:00 +02:00
|
|
|
imports = [
|
|
|
|
./blocks.nix
|
|
|
|
];
|
|
|
|
|
2021-09-08 18:23:21 +02:00
|
|
|
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
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2023-05-06 10:54:03 +02:00
|
|
|
extraConfig = ''
|
|
|
|
allow ${config.sbruder.wireguard.home.subnet};
|
|
|
|
deny all;
|
|
|
|
'';
|
|
|
|
|
2021-09-08 18:23:21 +02:00
|
|
|
locations = {
|
|
|
|
"/imprint/".alias = "${pkgs.sbruder.imprint}/";
|
2023-04-29 09:41:00 +02:00
|
|
|
"/transparency/" = {
|
2024-01-10 21:41:34 +01:00
|
|
|
alias = "/var/www/transparency/";
|
2023-04-29 09:41:00 +02:00
|
|
|
extraConfig = ''
|
|
|
|
autoindex on;
|
|
|
|
charset utf-8;
|
|
|
|
'';
|
|
|
|
};
|
2021-09-08 18:23:21 +02:00
|
|
|
};
|
|
|
|
};
|
2023-12-31 17:08:50 +01:00
|
|
|
|
|
|
|
services.nginx.virtualHosts."nitter.sbruder.xyz" = goneVhost;
|
|
|
|
services.nginx.virtualHosts."libreddit.sbruder.xyz" = goneVhost;
|
2021-09-08 18:23:21 +02:00
|
|
|
}
|