From 5d169c3ef29fcff2951b107a9fd2bd9e7b16c2fe Mon Sep 17 00:00:00 2001 From: Robin Raymond Date: Fri, 23 Feb 2018 14:56:28 +0100 Subject: [PATCH] fixes #88 --- mail-server/systemd.nix | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/mail-server/systemd.nix b/mail-server/systemd.nix index a59e8ce..e009f44 100644 --- a/mail-server/systemd.nix +++ b/mail-server/systemd.nix @@ -41,9 +41,13 @@ let createDhParameterFile = '' # Create a dh parameter file - ${pkgs.openssl}/bin/openssl \ - dhparam ${builtins.toString cfg.dhParamBitLength} \ - > "${cfg.certificateDirectory}/dh.pem" + if [ ! -f "''${cfg.certificateDirectory}/dh.pem" ] + then + mkdir -p "${cfg.certificateDirectory}" + ${pkgs.openssl}/bin/openssl \ + dhparam ${builtins.toString cfg.dhParamBitLength} \ + > "${cfg.certificateDirectory}/dh.pem" + fi ''; createDomainDkimCert = dom: