1 { config, lib, pkgs, ... }:
6 cfg = config.services.nextdns;
13 description = "Whether to enable the NextDNS DNS/53 to DoH Proxy service.";
15 arguments = mkOption {
16 type = types.listOf types.str;
18 example = [ "-config" "10.0.3.0/24=abcdef" ];
19 description = "Additional arguments to be passed to nextdns run.";
24 # https://github.com/nextdns/nextdns/blob/628ea509eaaccd27adb66337db03e5b56f6f38a8/host/service/systemd/service.go
25 config = mkIf cfg.enable {
26 systemd.services.nextdns = {
27 description = "NextDNS DNS/53 to DoH Proxy";
29 SERVICE_RUN_MODE = "1";
31 startLimitIntervalSec = 5;
34 ExecStart = "${pkgs.nextdns}/bin/nextdns run ${escapeShellArgs config.services.nextdns.arguments}";
36 LimitMEMLOCK = "infinity";
38 after = [ "network.target" ];
39 before = [ "nss-lookup.target" ];
40 wants = [ "nss-lookup.target" ];
41 wantedBy = [ "multi-user.target" ];