nixos-config/mastus/www.nix

33 lines
701 B
Nix
Raw Normal View History

2015-10-25 08:29:49 +00:00
{ config, pkgs, ... }:
{
2016-06-17 05:48:07 +00:00
systemd.services.createNginxDH = rec {
2015-10-25 08:29:49 +00:00
path = [ pkgs.openssl ];
serviceConfig = { Type = "oneshot"; RemainAfterExit = "yes"; };
wantedBy = [ "nginx.service" ];
2016-06-17 05:48:07 +00:00
before = wantedBy;
2015-10-25 08:29:49 +00:00
script = ''
if [ ! -f /etc/nginx/dhparam.pem ]; then
mkdir -p /etc/nginx/
openssl dhparam 2048 >/etc/nginx/dhparam.pem
fi
'';
};
services.nginx = {
enable = true;
2015-12-05 12:41:20 +00:00
2019-08-25 16:04:33 +00:00
recommendedTlsSettings = true;
recommendedOptimisation = true;
2015-12-05 12:41:20 +00:00
2019-08-25 16:04:33 +00:00
sslDhparam = "/etc/nginx/dhparam.pem";
virtualHosts."_" = {
default = true;
addSSL = true;
useACMEHost = "gebner.org";
globalRedirect = "gebner.org";
2018-04-07 09:08:09 +00:00
};
2015-10-25 08:29:49 +00:00
};
}