dnscrypt listening subnets
This commit is contained in:
@@ -30,7 +30,7 @@ in
|
|||||||
};
|
};
|
||||||
localhost6 = lib.mkOption {
|
localhost6 = lib.mkOption {
|
||||||
type = lib.types.str;
|
type = lib.types.str;
|
||||||
default = "::1";
|
default = "[::1]";
|
||||||
description = "The localhost ipv6 address.";
|
description = "The localhost ipv6 address.";
|
||||||
};
|
};
|
||||||
secureHost = lib.mkOption {
|
secureHost = lib.mkOption {
|
||||||
|
|||||||
@@ -1,10 +1,23 @@
|
|||||||
{ config, lib, ... }:
|
{ config, lib, ... }:
|
||||||
|
let
|
||||||
|
stripCidr = cidr: cidr |> lib.splitString "/" |> builtins.head;
|
||||||
|
wgListenIps = config.my.wgInterfaces |> builtins.attrValues;
|
||||||
|
wgListenAddrs = wgListenIps |> builtins.map (ip: "${stripCidr ip}:53");
|
||||||
|
in
|
||||||
{
|
{
|
||||||
options.my.services.network.enable = lib.mkEnableOption "network configuration and services";
|
options.my.services.network.enable = lib.mkEnableOption "network configuration and services";
|
||||||
config = lib.mkIf config.my.services.network.enable {
|
config = lib.mkIf config.my.services.network.enable {
|
||||||
networking = {
|
networking = {
|
||||||
enableIPv6 = true;
|
enableIPv6 = true;
|
||||||
firewall.enable = true;
|
firewall = {
|
||||||
|
enable = true;
|
||||||
|
interfaces = lib.mkIf config.my.services.wireguard.enable {
|
||||||
|
wg0 = {
|
||||||
|
allowedTCPPorts = [ 53 ];
|
||||||
|
allowedUDPPorts = [ 53 ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
dhcpcd.extraConfig = "nohook resolv.conf";
|
dhcpcd.extraConfig = "nohook resolv.conf";
|
||||||
networkmanager = {
|
networkmanager = {
|
||||||
enable = true;
|
enable = true;
|
||||||
@@ -19,6 +32,16 @@
|
|||||||
settings = {
|
settings = {
|
||||||
ipv6_servers = true;
|
ipv6_servers = true;
|
||||||
require_dnssec = true;
|
require_dnssec = true;
|
||||||
|
log_level = 4;
|
||||||
|
listen_addresses = [
|
||||||
|
"${config.my.localhost}:53"
|
||||||
|
"${config.my.localhost6}:53"
|
||||||
|
]
|
||||||
|
++ lib.optionals config.my.services.wireguard.enable wgListenAddrs;
|
||||||
|
query_log = {
|
||||||
|
file = "/var/lib/dnscrypt-proxy/query.log";
|
||||||
|
format = "tsv";
|
||||||
|
};
|
||||||
sources.public-resolvers = {
|
sources.public-resolvers = {
|
||||||
urls = [
|
urls = [
|
||||||
"https://raw.githubusercontent.com/DNSCrypt/dnscrypt-resolvers/master/v3/public-resolvers.md"
|
"https://raw.githubusercontent.com/DNSCrypt/dnscrypt-resolvers/master/v3/public-resolvers.md"
|
||||||
|
|||||||
Reference in New Issue
Block a user