darwin: clash-meta-client: refactor
This commit is contained in:
parent
a5b4059d49
commit
47fdb5cf6e
1 changed files with 12 additions and 9 deletions
|
@ -1,25 +1,28 @@
|
||||||
{
|
{
|
||||||
inputs,
|
inputs,
|
||||||
pkgs,
|
pkgs,
|
||||||
|
lib,
|
||||||
...
|
...
|
||||||
}: {
|
}: let
|
||||||
environment.variables = {
|
env = {
|
||||||
"http_proxy" = "http://127.0.0.1:7890";
|
"http_proxy" = "http://127.0.0.1:7890";
|
||||||
"https_proxy" = "http://127.0.0.1:7890";
|
"https_proxy" = "http://127.0.0.1:7890";
|
||||||
"ftp_proxy" = "http://127.0.0.1:7890";
|
"ftp_proxy" = "http://127.0.0.1:7890";
|
||||||
"rsync_proxy" = "http://127.0.0.1:7890";
|
"rsync_proxy" = "http://127.0.0.1:7890";
|
||||||
};
|
};
|
||||||
|
in {
|
||||||
|
# TODO: not run as root
|
||||||
|
|
||||||
launchd.daemons."nix-daemon".environment = {
|
# Proxy environment variables
|
||||||
"http_proxy" = "http://127.0.0.1:7890";
|
environment.variables = env;
|
||||||
"https_proxy" = "http://127.0.0.1:7890";
|
launchd.daemons."nix-daemon".environment = env;
|
||||||
"ftp_proxy" = "http://127.0.0.1:7890";
|
|
||||||
"rsync_proxy" = "http://127.0.0.1:7890";
|
|
||||||
};
|
|
||||||
|
|
||||||
|
# launchd service
|
||||||
launchd.daemons."clash-meta" = {
|
launchd.daemons."clash-meta" = {
|
||||||
command = "${pkgs.clash-meta}/bin/clash-meta -d /etc/clash-meta";
|
command = "${lib.getExe pkgs.clash-meta} -d /etc/clash-meta";
|
||||||
|
serviceConfig.RunAtLoad = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Web interface
|
||||||
environment.etc."clash-meta/metacubexd".source = inputs.self.packages.${pkgs.system}.metacubexd;
|
environment.etc."clash-meta/metacubexd".source = inputs.self.packages.${pkgs.system}.metacubexd;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue