networking: modify proxy configurations
- removed `environment.systemPackages = with pkgs; [ clash-meta ];`, as I found it isn't nessessary... - use same environment variables on different platforms and alias
This commit is contained in:
parent
78010ed6e9
commit
84bfa9817a
3 changed files with 8 additions and 15 deletions
|
@ -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" ];
|
||||
|
|
|
@ -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 = {
|
||||
|
|
|
@ -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";
|
||||
};
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue