nixos: clash-meta-client: move setproxy aliaes

This commit is contained in:
Guanran Wang 2024-01-27 03:50:18 +08:00
parent fc231ebf75
commit 0dcf6ffd7c
Signed by: nyancat
SSH key fingerprint: SHA256:8oWGKciPALWut/6WA27oFKofX+6Wtc0gQnsefXLQx/8
3 changed files with 11 additions and 6 deletions

View file

@ -51,11 +51,5 @@
home.shellAliases = {
".." = "cd ..";
"farsee" = "curl -F 'c=@-' 'https://fars.ee/'"; # pb
# 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";
};
}

View file

@ -4,6 +4,9 @@
inputs,
...
}: {
### home-manager
home-manager.users.guanranwang.imports = [./home];
services.clash = {
enable = true;
package = pkgs.clash-meta;

View file

@ -0,0 +1,8 @@
{osConfig, ...}: let
inherit (osConfig.networking) proxy;
in {
home.shellAliases = {
"setproxy" = "export http_proxy=${proxy.httpProxy} https_proxy=${proxy.httpsProxy} all_proxy=${proxy.allProxy} ftp_proxy=${proxy.ftpProxy} rsync_proxy=${proxy.rsyncProxy}";
"unsetproxy" = "set -e http_proxy https_proxy all_proxy ftp_proxy rsync_proxy";
};
}