11 cfg = config.services.nextdns;
19 description = "Whether to enable the NextDNS DNS/53 to DoH Proxy service.";
21 arguments = mkOption {
22 type = types.listOf types.str;
28 description = "Additional arguments to be passed to nextdns run.";
33 # https://github.com/nextdns/nextdns/blob/628ea509eaaccd27adb66337db03e5b56f6f38a8/host/service/systemd/service.go
34 config = mkIf cfg.enable {
35 systemd.services.nextdns = {
36 description = "NextDNS DNS/53 to DoH Proxy";
38 SERVICE_RUN_MODE = "1";
40 startLimitIntervalSec = 5;
43 ExecStart = "${pkgs.nextdns}/bin/nextdns run ${escapeShellArgs config.services.nextdns.arguments}";
45 LimitMEMLOCK = "infinity";
47 after = [ "network.target" ];
48 before = [ "nss-lookup.target" ];
49 wants = [ "nss-lookup.target" ];
50 wantedBy = [ "multi-user.target" ];