From b973f3176aec4689720539858138bf6bbc198aa8 Mon Sep 17 00:00:00 2001 From: Guanran Wang Date: Sat, 4 Nov 2023 18:22:10 +0800 Subject: [PATCH] darwin: add proxy to nix-daemon --- .../guanranwang/darwin/presets/core/proxy.nix | 26 +++++++++---------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/users/guanranwang/darwin/presets/core/proxy.nix b/users/guanranwang/darwin/presets/core/proxy.nix index c170bd1..a84f276 100644 --- a/users/guanranwang/darwin/presets/core/proxy.nix +++ b/users/guanranwang/darwin/presets/core/proxy.nix @@ -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; }