20 lines
411 B
Nix
20 lines
411 B
Nix
|
{ config, pkgs, ... }:
|
||
|
|
||
|
{
|
||
|
systemd.services.createNginxDH = {
|
||
|
path = [ pkgs.openssl ];
|
||
|
serviceConfig = { Type = "oneshot"; RemainAfterExit = "yes"; };
|
||
|
wantedBy = [ "nginx.service" ];
|
||
|
script = ''
|
||
|
if [ ! -f /etc/nginx/dhparam.pem ]; then
|
||
|
mkdir -p /etc/nginx/
|
||
|
openssl dhparam 2048 >/etc/nginx/dhparam.pem
|
||
|
fi
|
||
|
'';
|
||
|
};
|
||
|
|
||
|
services.nginx = {
|
||
|
enable = true;
|
||
|
};
|
||
|
}
|