Jump to content

Mihomo/zh: Difference between revisions

From Official NixOS Wiki
Oluceps (talk | contribs)
Created page with "在NixOS上启用mihomo服务:"
 
Oluceps (talk | contribs)
Created page with "<syntaxhighlight lang="nix"> services.mihomo = { enable = true; configFile = "/path/to/config.yaml"; #... }; </syntaxhighlight>"
Line 6: Line 6:
在NixOS上启用mihomo服务:
在NixOS上启用mihomo服务:


<div lang="en" dir="ltr" class="mw-content-ltr">
<syntaxhighlight lang="nix">
<syntaxhighlight lang="nix">
services.mihomo = {
services.mihomo = {
Line 14: Line 13:
};
};
</syntaxhighlight>
</syntaxhighlight>
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
<div lang="en" dir="ltr" class="mw-content-ltr">

Revision as of 14:55, 28 February 2025

mihomo (formerly known as clash-meta), is a widely-used anti-censorship proxy application.

在NixOS上启用mihomo服务:

services.mihomo = {
  enable = true;
  configFile = "/path/to/config.yaml";
  #...
};

TUN Mode

NOTICE: The tunMode option in NixOS module only grants necessary permissions for the service. To actually enable TUN, you need to edit the configFile. See official documentation.

Troubleshooting

If encountering issues with transparent proxy:

  • Check kernel logs with dmesg
  • If seeing massive "refuse" messages for specific network devices:
    • NixOS enables firewall by default, try disabling firewall
    • If problem is solved, try sequentially:
      • Add tun device to trustedInterfaces
      • Disable checkReversePath
  • If seeing massive "refuse" messages for specific ports:
    • Try allow the tproxy port in firewall if you're trying tproxy transparent proxy.

See also