server/web.nix
2024-04-07 00:58:22 +02:00

36 lines
762 B
Nix

{ config, pkgs, ... }:
{
# Group for people who can edit the website
users.groups.www = {};
# Directory for web content
systemd.tmpfiles.rules = [
"d /var/www/kamoshi.org 775 root www"
];
# Automatically renew certs
security.acme = {
acceptTerms = true;
defaults.email = "maciej@kamoshi.org";
};
networking.firewall.allowedTCPPorts = [ 80 443 ];
services = {
nginx = {
enable = true;
recommendedTlsSettings = true;
recommendedGzipSettings = true;
recommendedOptimisation = true;
recommendedProxySettings = true;
virtualHosts = {
"kamoshi.org" = {
root = "/var/www/kamoshi.org";
forceSSL = true;
enableACME = true;
};
};
};
};
}