server/hosts/fili/services/websites/homepage.nix
Jana Dönszelmann ca66e8d7b2
Some checks failed
/ lint (push) Failing after 28s
update some vim stuff
2026-03-31 09:36:54 +02:00

46 lines
928 B
Nix

{ flakes, pkgs, ... }:
let
cache = pkg: ''
location ~* \.(png|jpg|jpeg|gif|svg|ico|woff|woff2|ttf)$ {
expires max;
add_header Cache-Control "public, no-transform";
root ${pkg};
}
'';
regular = "${flakes.homepage.packages.${pkgs.system}.website}";
gay = "${flakes.homepage.packages.${pkgs.system}.website-gay}";
ssl = {
forceSSL = true;
http2 = true;
enableACME = true;
};
base =
pkg:
{
extraConfig = cache pkg;
}
// ssl;
site =
pkg:
{
locations."/".root = pkg;
}
// (base pkg);
redirect =
return:
{
locations."/".return = return;
}
// ssl;
in
{
services.nginx = {
virtualHosts = {
"donsz.nl" = site regular;
"jdonszelmann.nl" = site regular;
"blog.donsz.nl" = redirect "301 https://donsz.nl/blog";
"gay.donsz.nl" = site gay;
"jana.is.fckn.gay" = site gay;
};
};
}