add homepage

This commit is contained in:
Jörg Thalheim 2023-07-04 19:40:45 +02:00
parent 5eacd27511
commit c01feb7583
5 changed files with 57 additions and 6 deletions

View File

@ -7,7 +7,8 @@
];
web01.imports = [
./web01.nix
inputs.srvos.nixosModules.mixins-nginx
./web01
];
};
}

View File

@ -1,3 +1,7 @@
{ ... }: {
{
imports = [
./homepage.nix
];
services.cloud-init.xfs.enable = true;
}

View File

@ -0,0 +1,32 @@
{ pkgs, ...}: {
security.acme.defaults.email = "admins@clan.lol";
security.acme.acceptTerms = true;
services.nginx = {
virtualHosts."clan.lol" = {
forceSSL = true;
enableACME = true;
root = pkgs.runCommand "clan.lol" {} ''
mkdir -p $out;
cat > $out/index.html <<EOF
<html>
<head>
<title>Clan</title>
</head>
<body><h1>Clan</h1></body>
</html>
EOF
'';
extraConfig = ''
charset utf-8;
source_charset utf-8;
'';
};
virtualHosts."www.clan.lol" = {
forceSSL = true;
enableACME = true;
globalRedirect = "clan.lol";
};
};
}

File diff suppressed because one or more lines are too long

View File

@ -16,3 +16,17 @@ resource "netlify_dns_record" "server_aaaa" {
type = "AAAA"
value = hcloud_server.server.ipv6_address
}
resource "netlify_dns_record" "www_a" {
zone_id = netlify_dns_zone.server.id
hostname = "www.${var.domain}"
type = "A"
value = hcloud_server.server.ipv4_address
}
resource "netlify_dns_record" "www_aaaa" {
zone_id = netlify_dns_zone.server.id
hostname = "www.${var.domain}"
type = "AAAA"
value = hcloud_server.server.ipv6_address
}