1
0
Fork 0
nixos-config/nixos/machines/hera/web.nix
Malte Brandy 082a2c069b
Put basicAuth secrets into nix-store
because everything else would be too much of a hazzle.
2020-10-04 16:24:18 +02:00

46 lines
1.1 KiB
Nix

{ config, pkgs, lib, ... }:
let
locations = {
"/" = {
extraConfig = ''
return 200 "Hello there. I hope you are having a very nice day! If you don't know what to find here, you probably don't care about this domain.";
'';
};
};
in {
networking.firewall.allowedTCPPorts = [ 80 443 ];
m-0.monitoring = [{
name = "hera-nginx";
host = "hera-intern:9113";
}];
security.acme.certs."hera.m-0.eu".keyType = "rsa4096";
services = {
nginx = {
enable = lib.mkForce pkgs.withSecrets;
virtualHosts = {
"tasks.maralorn.de" = {
basicAuthFile = pkgs.privateFile "basic-auth/kassandra";
forceSSL = true;
enableACME = true;
locations = {
"/" = {
proxyPass = "http://[::1]:8000";
proxyWebsockets = true;
};
};
};
"hera.m-0.eu" = {
enableACME = true;
forceSSL = true;
inherit locations;
};
"maralorn.de" = {
enableACME = true;
forceSSL = true;
inherit locations;
};
};
};
};
}