This process was automated by [my fork of `nix-doc-munge`]; thanks
to @pennae for writing this tool! It automatically checks that the
resulting documentation doesn't change, although my fork loosens
this a little to ignore some irrelevant whitespace and typographical
differences.
As of this commit there is no DocBook remaining in the options
documentation.
You can play along at home if you want to reproduce this commit:
$ NIX_PATH=nixpkgs=flake:nixpkgs/c1bca7fe84c646cfd4ebf3482c0e6317a0b13f22 \
nix shell nixpkgs#coreutils \
-c find . -name '*.nix' \
-exec nix run github:emilazy/nix-doc-munge/0a7190f600027bf7baf6cb7139e4d69ac2f51062 \
{} +
[my fork of `nix-doc-munge`]: https://github.com/emilazy/nix-doc-munge
66 lines
1.8 KiB
Nix
66 lines
1.8 KiB
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
with lib;
|
|
|
|
let
|
|
cfg = config.services.privoxy;
|
|
in
|
|
{
|
|
options = {
|
|
services.privoxy.enable = mkOption {
|
|
type = types.bool;
|
|
default = false;
|
|
description = lib.mdDoc "Whether to enable the privoxy proxy service.";
|
|
};
|
|
|
|
services.privoxy.listenAddress = mkOption {
|
|
type = types.str;
|
|
default = "127.0.0.1:8118";
|
|
description = lib.mdDoc "The address and TCP port on which privoxy will listen.";
|
|
};
|
|
|
|
services.privoxy.package = mkOption {
|
|
type = types.package;
|
|
default = pkgs.privoxy;
|
|
example = literalExpression "pkgs.privoxy";
|
|
description = lib.mdDoc "This option specifies the privoxy package to use.";
|
|
};
|
|
|
|
services.privoxy.config = mkOption {
|
|
type = types.lines;
|
|
default = "";
|
|
example = "forward / upstream.proxy:8080";
|
|
description = lib.mdDoc "Config to use for privoxy";
|
|
};
|
|
|
|
services.privoxy.templdir = mkOption {
|
|
type = types.path;
|
|
default = "${pkgs.privoxy}/etc/templates";
|
|
defaultText = "\${pkgs.privoxy}/etc/templates";
|
|
description = lib.mdDoc "Directory for privoxy template files.";
|
|
};
|
|
|
|
services.privoxy.confdir = mkOption {
|
|
type = types.nullOr types.path;
|
|
default = null;
|
|
description = lib.mdDoc "Directory for privoxy files such as .action and .filter.";
|
|
};
|
|
};
|
|
|
|
config = mkIf cfg.enable {
|
|
environment.etc."privoxy-config".text = ''
|
|
${optionalString (cfg.confdir != null) "confdir ${cfg.confdir}"}
|
|
templdir ${cfg.templdir}
|
|
listen-address ${cfg.listenAddress}
|
|
${cfg.config}
|
|
'';
|
|
|
|
launchd.user.agents.privoxy = {
|
|
path = [ config.environment.systemPath ];
|
|
command = ''
|
|
${cfg.package}/bin/privoxy /etc/privoxy-config
|
|
'';
|
|
serviceConfig.KeepAlive = true;
|
|
};
|
|
};
|
|
}
|