From 9ade8f6eb774dc7d19d82a070199b5024786b819 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Isma=C3=ABl=20Bouya?= Date: Fri, 17 May 2019 01:43:18 +0200 Subject: Use acme directory config rather than hardcoding the value --- modules/private/databases/mariadb.nix | 4 ++-- modules/private/databases/openldap/default.nix | 6 +++--- modules/private/databases/postgresql.nix | 4 ++-- modules/websites/default.nix | 8 ++++---- 4 files changed, 11 insertions(+), 11 deletions(-) (limited to 'modules') diff --git a/modules/private/databases/mariadb.nix b/modules/private/databases/mariadb.nix index 21f4359..cc99c3c 100644 --- a/modules/private/databases/mariadb.nix +++ b/modules/private/databases/mariadb.nix @@ -54,8 +54,8 @@ in { dataDir = cfg.dataDir; extraOptions = '' ssl_ca = ${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt - ssl_key = /var/lib/acme/mysql/key.pem - ssl_cert = /var/lib/acme/mysql/fullchain.pem + ssl_key = ${config.security.acme.directory}/mysql/key.pem + ssl_cert = ${config.security.acme.directory}/mysql/fullchain.pem ''; }; diff --git a/modules/private/databases/openldap/default.nix b/modules/private/databases/openldap/default.nix index 850f3ff..46f85d2 100644 --- a/modules/private/databases/openldap/default.nix +++ b/modules/private/databases/openldap/default.nix @@ -33,9 +33,9 @@ let directory ${cfg.dataDir} overlay memberof - TLSCertificateFile /var/lib/acme/ldap/cert.pem - TLSCertificateKeyFile /var/lib/acme/ldap/key.pem - TLSCACertificateFile /var/lib/acme/ldap/fullchain.pem + TLSCertificateFile ${config.security.acme.directory}/ldap/cert.pem + TLSCertificateKeyFile ${config.security.acme.directory}/ldap/key.pem + TLSCACertificateFile ${config.security.acme.directory}/ldap/fullchain.pem TLSCACertificatePath ${pkgs.cacert.unbundled}/etc/ssl/certs/ #This makes openldap crash #TLSCipherSuite DEFAULT diff --git a/modules/private/databases/postgresql.nix b/modules/private/databases/postgresql.nix index 26242a8..8c36d84 100644 --- a/modules/private/databases/postgresql.nix +++ b/modules/private/databases/postgresql.nix @@ -73,8 +73,8 @@ in { lc_time = 'en_US.UTF-8' default_text_search_config = 'pg_catalog.english' ssl = on - ssl_cert_file = '/var/lib/acme/postgresql/fullchain.pem' - ssl_key_file = '/var/lib/acme/postgresql/key.pem' + ssl_cert_file = '${config.security.acme.directory}/postgresql/fullchain.pem' + ssl_key_file = '${config.security.acme.directory}/postgresql/key.pem' ''; authentication = '' local all postgres ident diff --git a/modules/websites/default.nix b/modules/websites/default.nix index b76aeea..e57f505 100644 --- a/modules/websites/default.nix +++ b/modules/websites/default.nix @@ -102,7 +102,7 @@ in serverAliases = [ "*" ]; enableSSL = false; logFormat = "combinedVhost"; - documentRoot = "/var/lib/acme/acme-challenge"; + documentRoot = "${config.security.acme.directory}/acme-challenge"; extraConfig = '' RewriteEngine on RewriteCond "%{REQUEST_URI}" "!^/\.well-known" @@ -131,9 +131,9 @@ in }; toVhost = ips: vhostConf: { enableSSL = true; - sslServerCert = "/var/lib/acme/${vhostConf.certName}/cert.pem"; - sslServerKey = "/var/lib/acme/${vhostConf.certName}/key.pem"; - sslServerChain = "/var/lib/acme/${vhostConf.certName}/chain.pem"; + sslServerCert = "${config.security.acme.directory}/${vhostConf.certName}/cert.pem"; + sslServerKey = "${config.security.acme.directory}/${vhostConf.certName}/key.pem"; + sslServerChain = "${config.security.acme.directory}/${vhostConf.certName}/chain.pem"; logFormat = "combinedVhost"; listen = map (ip: { inherit ip; port = 443; }) ips; hostName = builtins.head vhostConf.hosts; -- cgit v1.2.3