diff --git a/home/default.nix b/home/default.nix index 08b9a2e..11991dc 100644 --- a/home/default.nix +++ b/home/default.nix @@ -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"; }; } diff --git a/nixos/profiles/common/opt-in/clash-meta-client/default.nix b/nixos/profiles/common/opt-in/clash-meta-client/default.nix index 1e29a7c..90cdc37 100644 --- a/nixos/profiles/common/opt-in/clash-meta-client/default.nix +++ b/nixos/profiles/common/opt-in/clash-meta-client/default.nix @@ -4,6 +4,9 @@ inputs, ... }: { + ### home-manager + home-manager.users.guanranwang.imports = [./home]; + services.clash = { enable = true; package = pkgs.clash-meta; diff --git a/nixos/profiles/common/opt-in/clash-meta-client/home/default.nix b/nixos/profiles/common/opt-in/clash-meta-client/home/default.nix new file mode 100644 index 0000000..da06bdc --- /dev/null +++ b/nixos/profiles/common/opt-in/clash-meta-client/home/default.nix @@ -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"; + }; +}