1 { config, lib, pkgs, ... }:
4 cfg = config.services.doh-proxy-rust;
8 options.services.doh-proxy-rust = {
10 enable = lib.mkEnableOption "doh-proxy-rust";
12 flags = lib.mkOption {
13 type = lib.types.listOf lib.types.str;
15 example = [ "--server-address=9.9.9.9:53" ];
17 A list of command-line flags to pass to doh-proxy. For details on the
18 available options, see <https://github.com/jedisct1/doh-server#usage>.
24 config = lib.mkIf cfg.enable {
25 systemd.services.doh-proxy-rust = {
26 description = "doh-proxy-rust";
27 after = [ "network.target" "nss-lookup.target" ];
28 wantedBy = [ "multi-user.target" ];
30 ExecStart = "${pkgs.doh-proxy-rust}/bin/doh-proxy ${lib.escapeShellArgs cfg.flags}";
35 CapabilityBoundingSet = "";
36 LockPersonality = true;
37 MemoryDenyWriteExecute = true;
38 NoNewPrivileges = true;
41 ProtectHostname = true;
42 ProtectKernelLogs = true;
44 RestrictAddressFamilies = "AF_INET AF_INET6";
45 RestrictNamespaces = true;
46 RestrictRealtime = true;
47 RestrictSUIDSGID = true;
48 SystemCallArchitectures = "native";
49 SystemCallErrorNumber = "EPERM";
50 SystemCallFilter = [ "@system-service" "~@privileged @resources" ];
55 meta.maintainers = with lib.maintainers; [ stephank ];