lol

nixos/acme: rename option credentialsFile to environmentFile

authored by

datafoo and committed by
Anderson Torres
ade414b6 5f105f87

+11 -7
+2 -2
nixos/modules/security/acme/default.md
··· 189 189 security.acme.certs."example.com" = { 190 190 domain = "*.example.com"; 191 191 dnsProvider = "rfc2136"; 192 - credentialsFile = "/var/lib/secrets/certs.secret"; 192 + environmentFile = "/var/lib/secrets/certs.secret"; 193 193 # We don't need to wait for propagation since this is a local DNS server 194 194 dnsPropagationCheck = false; 195 195 }; ··· 256 256 security.acme.defaults.email = "admin+acme@example.com"; 257 257 security.acme.defaults = { 258 258 dnsProvider = "rfc2136"; 259 - credentialsFile = "/var/lib/secrets/certs.secret"; 259 + environmentFile = "/var/lib/secrets/certs.secret"; 260 260 # We don't need to wait for propagation since this is a local DNS server 261 261 dnsPropagationCheck = false; 262 262 };
+8 -4
nixos/modules/security/acme/default.nix
··· 362 362 "/var/lib/acme/.lego/${cert}/${certDir}:/tmp/certificates" 363 363 ]; 364 364 365 - # Only try loading the credentialsFile if the dns challenge is enabled 366 - EnvironmentFile = mkIf useDns data.credentialsFile; 365 + # Only try loading the environmentFile if the dns challenge is enabled 366 + EnvironmentFile = mkIf useDns data.environmentFile; 367 367 368 368 Environment = mkIf useDns 369 369 (mapAttrsToList (k: v: ''"${k}=%d/${k}"'') data.credentialFiles); ··· 502 502 defaultText = if isDefaults then default else literalExpression "config.security.acme.defaults.${name}"; 503 503 }; 504 504 in { 505 + imports = [ 506 + (mkRenamedOptionModule [ "credentialsFile" ] [ "environmentFile" ]) 507 + ]; 508 + 505 509 options = { 506 510 validMinDays = mkOption { 507 511 type = types.int; ··· 613 617 ''; 614 618 }; 615 619 616 - credentialsFile = mkOption { 620 + environmentFile = mkOption { 617 621 type = types.nullOr types.path; 618 - inherit (defaultAndText "credentialsFile" null) default defaultText; 622 + inherit (defaultAndText "environmentFile" null) default defaultText; 619 623 description = lib.mdDoc '' 620 624 Path to an EnvironmentFile for the cert's service containing any required and 621 625 optional environment variables for your selected dnsProvider.
+1 -1
nixos/tests/acme.nix
··· 18 18 dnsConfig = nodes: { 19 19 dnsProvider = "exec"; 20 20 dnsPropagationCheck = false; 21 - credentialsFile = pkgs.writeText "wildcard.env" '' 21 + environmentFile = pkgs.writeText "wildcard.env" '' 22 22 EXEC_PATH=${dnsScript nodes} 23 23 EXEC_POLLING_INTERVAL=1 24 24 EXEC_PROPAGATION_TIMEOUT=1