dnsmasq.nix 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. { config, lib, ... }:
  2. with lib;
  3. {
  4. services.dnsmasq = {
  5. alwaysKeepRunning = mkDefault true;
  6. resolveLocalQueries = mkDefault true;
  7. settings = {
  8. all-servers = mkDefault true;
  9. bind-dynamic = mkDefault true;
  10. bogus-priv = mkDefault true;
  11. cache-size = mkDefault 1500;
  12. domain = mkIf config.services.avahi.enable
  13. config.services.avahi.domainName;
  14. domain-needed = mkDefault true;
  15. expand-hosts = mkDefault true;
  16. listen-address = mkDefault "127.0.0.1";
  17. no-negcache = mkDefault true;
  18. no-poll = mkDefault true;
  19. no-resolv = mkDefault true;
  20. server = builtins.concatLists [
  21. (optionals config.services.avahi.enable [
  22. "/${config.services.avahi.domainName}/"
  23. ]) [
  24. "8.8.8.8"
  25. "8.8.4.4"
  26. "1.1.1.1"
  27. "1.0.0.1"
  28. ] (optionals config.services.yggdrasil.enable [
  29. "/ygg/324:71e:281a:9ed3::53"
  30. "/meshname/324:71e:281a:9ed3::53"
  31. "/meship/324:71e:281a:9ed3::53"
  32. "/lib/324:71e:281a:9ed3::53"
  33. "/bazar/324:71e:281a:9ed3::53"
  34. "/emc/324:71e:281a:9ed3::53"
  35. "/coin/324:71e:281a:9ed3::53"
  36. ])
  37. ];
  38. };
  39. };
  40. }