Add an example nixos config using this site

This commit is contained in:
Luka Korošec 2025-06-20 23:11:18 +02:00
parent 09a424d956
commit f2f8efdc1d
Signed by: Pizmovc
GPG key ID: 4E1338930C2F3572
4 changed files with 173 additions and 0 deletions

View file

@ -0,0 +1,20 @@
{ inputs, pkgs, ... }:
let
site-url = "example.com";
in
{
services.caddy = {
enable = true;
# Needs `http://` prefix so that it does not try to request TLS certificates and redirect to 443
virtualHosts."http://${site-url}".extraConfig = ''
file_server
root * ${inputs.our-site.packages."${pkgs.system}".default}
encode gzip
'';
};
environment.shellAliases = {
# Test our site
curl-site = "curl -H \"Host: ${site-url}\" localhost";
};
}