badbayan.duckdns.org.nix 779 B

123456789101112131415161718192021222324252627282930313233343536
  1. { config, inputs, ... }:
  2. let
  3. dns = "duckdns";
  4. domain = "badbayan.duckdns.org";
  5. email = "badya65@gmail.com";
  6. in {
  7. age.secrets = with inputs.self.modules; {
  8. ${dns}.file = secrets.${dns};
  9. };
  10. security.acme.certs.${domain} = {
  11. environmentFile = config.age.secrets.${dns}.path;
  12. domain = "*." + domain;
  13. dnsPropagationCheck = true;
  14. dnsProvider = dns;
  15. inherit email;
  16. extraDomainNames = [ domain ];
  17. inherit (config.security.acme.defaults) group;
  18. };
  19. services.nginx.virtualHosts = {
  20. ${domain} = {
  21. forceSSL = true;
  22. enableACME = true;
  23. acmeRoot = null;
  24. globalRedirect = "notbad.dynv6.net";
  25. };
  26. "*.${domain}" = {
  27. forceSSL = true;
  28. useACMEHost = domain;
  29. globalRedirect = domain;
  30. };
  31. };
  32. }