nix-config/hosts/containers/matemat/default.nix

51 lines
1.1 KiB
Nix

{ lib, pkgs, ... }:
{
c3d2 = {
isInHq = true;
hq.interface = "eth0";
};
networking = {
hostName = "matemat";
interfaces.eth0.useDHCP = lib.mkForce true;
firewall.allowedTCPPorts = [ 80 443 ];
};
services.yammat.enable = true;
services.nginx = {
enable = true;
recommendedProxySettings = true;
virtualHosts."matemat.hq.c3d2.de" = {
default = true;
forceSSL = true;
enableACME = true;
locations."/" = {
proxyPass = "http://localhost:3000";
extraConfig = ''
satisfy any;
auth_basic secured;
auth_basic_user_file ${pkgs.matemat-auth};
allow 2a02:8106:208:5200::/56;
allow 2a02:8106:211:e900::/56;
allow 172.22.99.0/24;
allow 172.20.72.0/21;
deny all;
'';
};
};
};
services.ssmtp = {
enable = true;
root = "nek0@c3d2.de";
useSTARTTLS = true;
hostName = "mail.c3d2.de";
domain = "matemat.hq.c3d2.de";
};
security.acme = {
acceptTerms = true;
email = "mail@c3d2.de";
};
}