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

54 lines
1.2 KiB
Nix
Raw Normal View History

{ hostRegistry, lib, pkgs, ... }:
{
2021-03-06 01:13:27 +01:00
c3d2 = {
isInHq = true;
hq.interface = "eth0";
};
networking.hostName = "matemat";
networking.useNetworkd = true;
networking.interfaces.eth0 = {
ipv4.addresses = [{
address = hostRegistry.hosts.matemat.ip4;
prefixLength = 26;
}];
2021-03-06 01:13:27 +01:00
};
networking.defaultGateway = "172.20.73.1";
networking.firewall.allowedTCPPorts = [ 80 443 ];
2021-03-06 01:13:27 +01:00
services.yammat.enable = true;
services.nginx = {
enable = true;
recommendedProxySettings = true;
virtualHosts."matemat.hq.c3d2.de" = {
default = true;
forceSSL = true;
enableACME = true;
2021-03-06 02:28:46 +01:00
locations."/" = {
proxyPass = "http://localhost:3000";
extraConfig = ''
satisfy any;
2021-03-06 02:28:46 +01:00
auth_basic secured;
auth_basic_user_file ${pkgs.matemat-auth};
2021-06-02 21:37:18 +02:00
allow 2a00:8180:2c00:200::/56;
allow 172.22.99.0/24;
allow 172.20.72.0/21;
deny all;
2021-03-06 02:28:46 +01:00
'';
};
2021-03-06 01:13:27 +01:00
};
};
2021-03-06 20:59:08 +01:00
services.ssmtp = {
enable = true;
root = "nek0@c3d2.de";
useTLS = true;
2021-03-06 20:59:08 +01:00
useSTARTTLS = true;
2021-05-28 04:54:26 +02:00
hostName = "mail.c3d2.de:587";
2021-03-06 20:59:08 +01:00
domain = "matemat.hq.c3d2.de";
settings = {
hostname = "matemat.hq.c3d2.de";
};
2021-03-06 20:59:08 +01:00
};
}