diff --git a/nixos/networking/proxy.nix b/nixos/networking/proxy.nix index ef52978..23bbc42 100644 --- a/nixos/networking/proxy.nix +++ b/nixos/networking/proxy.nix @@ -1,14 +1,9 @@ { pkgs, config, ... }: { - networking = { - proxy = { - default = "http://127.0.0.1:7890/"; - noProxy = "127.0.0.1,localhost"; - }; - }; + networking.proxy.default = "http://127.0.0.1:7890/"; - environment.systemPackages = with pkgs; [ clash-meta ]; + #environment.systemPackages = with pkgs; [ clash-meta ]; systemd.services."clash-meta" = { wantedBy = [ "multi-user.target" ]; after = [ "network-online.target" ]; diff --git a/users/guanranwang/home-manager/common/home.nix b/users/guanranwang/home-manager/common/home.nix index 22e7faf..c6f5b28 100644 --- a/users/guanranwang/home-manager/common/home.nix +++ b/users/guanranwang/home-manager/common/home.nix @@ -12,10 +12,7 @@ # changes in each release. stateVersion = "23.05"; - shellAliases = - let - proxy = "http://127.0.0.1:7890/"; - in { + shellAliases = { # navigation "l" = "${pkgs.eza}/bin/eza -Fhl --icons --git"; "ll" = "${pkgs.eza}/bin/eza -Fahl --icons --git"; @@ -37,7 +34,8 @@ "clock" = "tty-clock -5Ccs"; # proxy - "setproxy" = "export https_proxy=${proxy} http_proxy=${proxy} all_proxy=${proxy}"; + "setproxy" = let proxy = "http://127.0.0.1:7890/"; + in "export http_proxy=${proxy} https_proxy=${proxy} ftp_proxy=${proxy} rsync_proxy=${proxy}"; "unsetproxy" = "set -e http_proxy https_proxy all_proxy"; # fish syntax (?) }; sessionVariables = { diff --git a/users/guanranwang/home-manager/darwin/home.nix b/users/guanranwang/home-manager/darwin/home.nix index 79659f2..df81d36 100644 --- a/users/guanranwang/home-manager/darwin/home.nix +++ b/users/guanranwang/home-manager/darwin/home.nix @@ -65,10 +65,10 @@ ]; sessionVariables = { - "https_proxy" = "http://127.0.0.1:7890"; "http_proxy" = "http://127.0.0.1:7890"; - "socks_proxy" = "socks5://127.0.0.1:7890"; - "all_proxy" = "socks5://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"; }; };