nixos/clash: add option descriptions
This commit is contained in:
parent
3bced27e51
commit
9cac96c5ff
1 changed files with 21 additions and 8 deletions
|
@ -7,21 +7,34 @@
|
||||||
cfg = config.services.clash;
|
cfg = config.services.clash;
|
||||||
in {
|
in {
|
||||||
options.services.clash = {
|
options.services.clash = {
|
||||||
enable = lib.mkEnableOption "Whether to enable Clash, A rule-based proxy in Go";
|
enable = lib.mkEnableOption "Whether to enable Clash, A rule-based proxy in Go.";
|
||||||
package = lib.mkPackageOption pkgs "clash" {};
|
package = lib.mkPackageOption pkgs "clash" {};
|
||||||
|
|
||||||
# TODO
|
|
||||||
webui = lib.mkOption {
|
|
||||||
default = null;
|
|
||||||
type = lib.types.nullOr lib.types.path;
|
|
||||||
};
|
|
||||||
configFile = lib.mkOption {
|
configFile = lib.mkOption {
|
||||||
default = null;
|
default = null;
|
||||||
type = lib.types.nullOr lib.types.path;
|
type = lib.types.nullOr lib.types.path;
|
||||||
|
description = "Configuration file to use.";
|
||||||
|
};
|
||||||
|
webui = lib.mkOption {
|
||||||
|
default = null;
|
||||||
|
type = lib.types.nullOr lib.types.path;
|
||||||
|
description = ''
|
||||||
|
Local web interface to use.
|
||||||
|
|
||||||
|
You can also use the following website, just in case:
|
||||||
|
- metacubexd:
|
||||||
|
- http://d.metacubex.one
|
||||||
|
- https://metacubex.github.io/metacubexd
|
||||||
|
- https://metacubexd.pages.dev
|
||||||
|
- yacd:
|
||||||
|
- https://yacd.haishan.me
|
||||||
|
- clash-dashboard (buggy):
|
||||||
|
- https://clash.razord.top
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
extraOpts = lib.mkOption {
|
extraOpts = lib.mkOption {
|
||||||
default = null;
|
default = null;
|
||||||
type = lib.types.nullOr lib.types.string;
|
type = lib.types.nullOr lib.types.string;
|
||||||
|
description = "Extra command line options to use.";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -52,8 +65,8 @@ in {
|
||||||
ExecStart = builtins.replaceStrings ["\n"] [" "] ''
|
ExecStart = builtins.replaceStrings ["\n"] [" "] ''
|
||||||
${lib.getExe cfg.package}
|
${lib.getExe cfg.package}
|
||||||
-d /etc/clash
|
-d /etc/clash
|
||||||
${lib.optionalString (cfg.webui != null) "-ext-ui ${cfg.webui}"}
|
|
||||||
${lib.optionalString (cfg.configFile != null) "-f \${CREDENTIALS_DIRECTORY}/configuration"}
|
${lib.optionalString (cfg.configFile != null) "-f \${CREDENTIALS_DIRECTORY}/configuration"}
|
||||||
|
${lib.optionalString (cfg.webui != null) "-ext-ui ${cfg.webui}"}
|
||||||
${lib.optionalString (cfg.extraOpts != null) cfg.extraOpts}
|
${lib.optionalString (cfg.extraOpts != null) cfg.extraOpts}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue