2023-09-19 00:17:43 +00:00
|
|
|
{ pkgs, config, ... }:
|
|
|
|
|
|
|
|
{
|
|
|
|
networking = {
|
|
|
|
proxy = {
|
|
|
|
default = "http://127.0.0.1:7890/";
|
|
|
|
noProxy = "127.0.0.1,localhost";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
environment.systemPackages = with pkgs; [ clash-meta ];
|
|
|
|
systemd.services."clash-meta" = {
|
|
|
|
wantedBy = [ "multi-user.target" ];
|
|
|
|
after = [ "network-online.target" ];
|
|
|
|
description = "Clash.Meta Daemon";
|
|
|
|
serviceConfig = {
|
|
|
|
Type = "simple";
|
|
|
|
WorkingDirectory = "/etc/clash-meta";
|
2023-09-20 21:23:10 +00:00
|
|
|
User = [ config.users.users."clash-meta".name ];
|
2023-09-19 00:17:43 +00:00
|
|
|
ExecStart = "${pkgs.clash-meta}/bin/clash-meta -d /etc/clash-meta";
|
|
|
|
Restart = "on-failure";
|
2023-09-20 21:23:10 +00:00
|
|
|
CapabilityBoundingSet = [
|
|
|
|
"CAP_NET_RAW"
|
|
|
|
"CAP_NET_ADMIN"
|
|
|
|
"CAP_NET_BIND_SERVICE"
|
|
|
|
];
|
|
|
|
AmbientCapabilities = [
|
|
|
|
"CAP_NET_RAW"
|
|
|
|
"CAP_NET_ADMIN"
|
|
|
|
"CAP_NET_BIND_SERVICE"
|
|
|
|
];
|
2023-09-19 00:17:43 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2023-09-27 04:05:53 +00:00
|
|
|
environment.etc."clash-meta/metacubexd".source = ../../users/guanranwang/home-manager/common/dotfiles/config/clash/metacubexd;
|
2023-09-19 00:17:43 +00:00
|
|
|
}
|