darwin: add proxy to nix-daemon

This commit is contained in:
Guanran Wang 2023-11-04 18:22:10 +08:00
parent 74327fb21c
commit b973f3176a
Signed by: nyancat
SSH key fingerprint: SHA256:8oWGKciPALWut/6WA27oFKofX+6Wtc0gQnsefXLQx/8

View file

@ -2,20 +2,7 @@
inputs,
pkgs,
...
}:
# README!!:
# I HAVE NO IDEA HOW LAUNCHD DAEMON WORKS
# USE AT YOUR OWN RISK
# it just works™
#
# Remember to manually copy `config.yaml` to `/etc/clash-meta`
# I have no idea how to get sops-nix working on darwin...
#
{
launchd.daemons."clash-meta" = {
command = "${pkgs.clash-meta}/bin/clash-meta -d /etc/clash-meta";
};
}: {
environment.variables = {
"http_proxy" = "http://127.0.0.1:7890";
"https_proxy" = "http://127.0.0.1:7890";
@ -23,5 +10,16 @@
"rsync_proxy" = "http://127.0.0.1:7890";
};
launchd.daemons."nix-daemon".environment = {
"http_proxy" = "http://127.0.0.1:7890";
"https_proxy" = "http://127.0.0.1:7890";
"ftp_proxy" = "http://127.0.0.1:7890";
"rsync_proxy" = "http://127.0.0.1:7890";
};
launchd.daemons."clash-meta" = {
command = "${pkgs.clash-meta}/bin/clash-meta -d /etc/clash-meta";
};
environment.etc."clash-meta/metacubexd".source = inputs.metacubexd;
}