os/hosts/frikandel/website.nix

50 lines
1 KiB
Nix

{
pkgs,
lib,
...
}: let
bbeu = pkgs.stdenv.mkDerivation {
name = "benjaminbaedorf.eu";
src = pkgs.fetchgit {
url = "https://git.pub.solar/b12f/benjaminbaedorf.eu.git";
rev = "281d06ee86782f6faf8ead79a35cc809118a6dbe";
hash = "sha256-T0g+kFQ9tMiZBlOxLcSUX3WBZM773w7Za6ePzb8K6Cg=";
sparseCheckout = [
"fonts"
"cows.jpg"
"fonts.css"
"index.html"
"public-pgp-benjamin-baedorf.asc"
];
};
installPhase = ''
mkdir -p $out
cp -r * $out/
'';
};
in {
security.acme.certs = {
"benjaminbaedorf.eu" = {};
"b12f.io" = {};
};
services.nginx.virtualHosts = {
"benjaminbaedorf.eu" = {
forceSSL = true;
useACMEHost = "benjaminbaedorf.eu";
locations."/".return = "302 https://b12f.io$request_uri";
};
"b12f.io" = {
forceSSL = true;
useACMEHost = "b12f.io";
locations."/" = {
root = bbeu;
index = "index.html";
tryFiles = "$uri $uri/ =404";
};
};
};
}