2023-07-18 00:13:33 +00:00
|
|
|
{ config, pkgs, self, ... }: {
|
2023-07-04 17:40:45 +00:00
|
|
|
security.acme.defaults.email = "admins@clan.lol";
|
|
|
|
security.acme.acceptTerms = true;
|
|
|
|
|
2023-07-18 00:13:33 +00:00
|
|
|
# www user to push website artifacts via ssh
|
|
|
|
users.users.www = {
|
|
|
|
openssh.authorizedKeys.keys = [
|
|
|
|
# ssh-homepage-key
|
|
|
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPcQi7FThpE2dFcb08d7DSQzhit8e/0W9OUZXasH0JJA ssh-homepage-key"
|
|
|
|
];
|
|
|
|
isNormalUser = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
# ensure /var/www can be accessed by nginx and www user
|
|
|
|
systemd.tmpfiles.rules = [
|
|
|
|
"d /var/www 0755 www nginx"
|
|
|
|
];
|
|
|
|
|
2023-07-04 17:40:45 +00:00
|
|
|
services.nginx = {
|
|
|
|
virtualHosts."clan.lol" = {
|
|
|
|
forceSSL = true;
|
|
|
|
enableACME = true;
|
2023-07-17 21:26:10 +00:00
|
|
|
# to be deployed via rsync
|
|
|
|
root = "/var/www";
|
2023-07-04 17:40:45 +00:00
|
|
|
extraConfig = ''
|
|
|
|
charset utf-8;
|
|
|
|
source_charset utf-8;
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
virtualHosts."www.clan.lol" = {
|
|
|
|
forceSSL = true;
|
|
|
|
enableACME = true;
|
|
|
|
globalRedirect = "clan.lol";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|