mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-23 15:33:13 +00:00
6afb255d97
these changes were generated with nixq 0.0.2, by running nixq ">> lib.mdDoc[remove] Argument[keep]" --batchmode nixos/**.nix nixq ">> mdDoc[remove] Argument[keep]" --batchmode nixos/**.nix nixq ">> Inherit >> mdDoc[remove]" --batchmode nixos/**.nix two mentions of the mdDoc function remain in nixos/, both of which are inside of comments. Since lib.mdDoc is already defined as just id, this commit is a no-op as far as Nix (and the built manual) is concerned.
45 lines
1.2 KiB
Nix
45 lines
1.2 KiB
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
with lib;
|
|
|
|
let
|
|
cfg = config.services.nextdns;
|
|
in {
|
|
options = {
|
|
services.nextdns = {
|
|
enable = mkOption {
|
|
type = types.bool;
|
|
default = false;
|
|
description = "Whether to enable the NextDNS DNS/53 to DoH Proxy service.";
|
|
};
|
|
arguments = mkOption {
|
|
type = types.listOf types.str;
|
|
default = [];
|
|
example = [ "-config" "10.0.3.0/24=abcdef" ];
|
|
description = "Additional arguments to be passed to nextdns run.";
|
|
};
|
|
};
|
|
};
|
|
|
|
# https://github.com/nextdns/nextdns/blob/628ea509eaaccd27adb66337db03e5b56f6f38a8/host/service/systemd/service.go
|
|
config = mkIf cfg.enable {
|
|
systemd.services.nextdns = {
|
|
description = "NextDNS DNS/53 to DoH Proxy";
|
|
environment = {
|
|
SERVICE_RUN_MODE = "1";
|
|
};
|
|
startLimitIntervalSec = 5;
|
|
startLimitBurst = 10;
|
|
serviceConfig = {
|
|
ExecStart = "${pkgs.nextdns}/bin/nextdns run ${escapeShellArgs config.services.nextdns.arguments}";
|
|
RestartSec = 120;
|
|
LimitMEMLOCK = "infinity";
|
|
};
|
|
after = [ "network.target" ];
|
|
before = [ "nss-lookup.target" ];
|
|
wants = [ "nss-lookup.target" ];
|
|
wantedBy = [ "multi-user.target" ];
|
|
};
|
|
};
|
|
}
|