homepage tinkering

This commit is contained in:
2025-07-19 14:50:54 +02:00
parent 323dfcbc82
commit f9cd612c37
6 changed files with 89 additions and 66 deletions

View File

@@ -1,6 +1,4 @@
{
self,
pkgs,
config,
lib,
...
@@ -16,7 +14,6 @@ in {
ports = [80 443];
in {
allowedTCPPorts = ports;
allowedUDPPorts = ports;
};
security.acme = {
@@ -36,8 +33,21 @@ in {
services.caddy = {
enable = true;
# environmentFile = config.age.secrets.cloudflare-env.path;
# package = self.packages.${pkgs.system}.caddy-with-plugins;
globalConfig = ''
auto_https off
'';
virtualHosts = {
"http://${config.server.domain}" = {
extraConfig = ''
redir https://{host}{uri}
'';
};
"http://*.${config.server.domain}" = {
extraConfig = ''
redir https://{host}{uri}
'';
};
};
};
};
}