From ebef75f0e60855da87f13ace62d09b193284b00c Mon Sep 17 00:00:00 2001 From: Lucas Savva Date: Sat, 24 Oct 2020 20:40:02 +0100 Subject: [PATCH] nixos/acme: Add data.email to othersHash in nixos > 20.09 (cherry picked from commit 79ecf069f5d71fb151b895b7de5f3d0fae7ce32a) --- nixos/modules/security/acme.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/nixos/modules/security/acme.nix b/nixos/modules/security/acme.nix index 740cd1242187..5a6184535d4d 100644 --- a/nixos/modules/security/acme.nix +++ b/nixos/modules/security/acme.nix @@ -104,7 +104,12 @@ let mkHash = with builtins; val: substring 0 20 (hashString "sha256" val); certDir = mkHash hashData; domainHash = mkHash "${concatStringsSep " " extraDomains} ${data.domain}"; - othersHash = mkHash "${toString acmeServer} ${data.keyType}"; + othersHash = mkHash ( + "${toString acmeServer} ${data.keyType}" + + ( + optionalString (versionOlder "20.09" config.system.stateVersion) data.email + ) + ); accountDir = "/var/lib/acme/.lego/accounts/" + othersHash; protocolOpts = if useDns then (