This commit is contained in:
Guanran Wang 2023-10-10 17:49:57 +08:00
commit f1180fd4a5
Signed by: nyancat
SSH key fingerprint: SHA256:8oWGKciPALWut/6WA27oFKofX+6Wtc0gQnsefXLQx/8
5 changed files with 39 additions and 11 deletions

View file

@ -3,5 +3,6 @@
{
imports = [
./dns.nix
./proxy.nix
];
}

View file

@ -0,0 +1,27 @@
{ 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...
#
{
#environment.systemPackages = with pkgs; [ clash-meta ];
# do i even need to add it to environment.systemPackages...
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";
"ftp_proxy" = "http://127.0.0.1:7890";
"rsync_proxy" = "http://127.0.0.1:7890";
};
environment.etc."clash-meta/metacubexd".source = ../../users/guanranwang/home-manager/common/dotfiles/config/clash/metacubexd;
}

View file

@ -15,7 +15,7 @@
"alt-tab"
"altserver"
"balenaetcher"
"clashx"
#"clashx"
"opencore-patcher"
#"element"

View file

@ -48,7 +48,7 @@
specialArgs = { inherit inputs; };
modules = [
./darwin # Entrypoint
./machines/darwin/imac-2017.nix # Hardware-specific configurations
./machines/darwin/imac-2017 # Hardware-specific configurations
# Machine-specific configurations (does such stuff even exist on nix-darwin)
./users/guanranwang/darwin.nix # User-specific configurations
./flakes/darwin/home-manager.nix # Flakes

View file

@ -5,9 +5,9 @@
username = "guanranwang";
homeDirectory = "/Users/guanranwang";
# Workaround for spotlight indexing
# https://github.com/nix-community/home-manager/issues/1341#issuecomment-1705731962_
activation = {
# Workaround for spotlight indexing
# https://github.com/nix-community/home-manager/issues/1341#issuecomment-1705731962_
trampolineApps = let
apps = pkgs.buildEnv {
name = "home-manager-applications";
@ -26,6 +26,13 @@
done
)
'';
setSystemProxy = let networksetup = /usr/sbin/networksetup;
in lib.hm.dag.entryAfter ["writeBoundary"] ''
${networksetup} -setwebproxystate "Wi-fi" on
${networksetup} -setwebproxy "Wi-fi" 127.0.0.1 7890
${networksetup} -setwebproxystate "Ethernet" on
${networksetup} -setwebproxy "Ethernet" 127.0.0.1 7890
'';
};
packages = with pkgs; [
@ -63,13 +70,6 @@
nixd
nil
];
sessionVariables = {
"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";
};
};
# macOS don't have fontconfig