From 7686f7209bf12051703fda43ed6aea3dc750f5d9 Mon Sep 17 00:00:00 2001 From: imbytecat Date: Sat, 11 Apr 2026 20:15:31 +0800 Subject: [PATCH] =?UTF-8?q?feat(mac-mini):=20=E5=90=AF=E7=94=A8=20Wake=20o?= =?UTF-8?q?n=20LAN=EF=BC=8C=E5=85=B3=E9=97=AD=20Power=20Nap?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hosts/mac-mini/default.nix | 7 ++++- lib/compose.yaml | 56 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 lib/compose.yaml diff --git a/hosts/mac-mini/default.nix b/hosts/mac-mini/default.nix index 802799d..a583ab8 100644 --- a/hosts/mac-mini/default.nix +++ b/hosts/mac-mini/default.nix @@ -15,10 +15,15 @@ power.restartAfterPowerFailure = true; power.restartAfterFreeze = true; - # ── Screen Sharing (VNC) ───────────────────────── + # ── Screen Sharing (VNC) & pmset ───────────────── system.activationScripts.postActivation.text = '' + # VNC launchctl enable system/com.apple.screensharing launchctl load -w /System/Library/LaunchDaemons/com.apple.screensharing.plist 2>/dev/null || true + # Wake on LAN + pmset -a womp 1 + # Disable Power Nap + pmset -a powernap 0 ''; system.stateVersion = 5; diff --git a/lib/compose.yaml b/lib/compose.yaml new file mode 100644 index 0000000..477a76b --- /dev/null +++ b/lib/compose.yaml @@ -0,0 +1,56 @@ +services: + grok2api: + image: ghcr.io/chenyme/grok2api:latest + restart: unless-stopped + volumes: + - ./volumes/data:/app/data + - ./volumes/logs:/app/logs + environment: + - TZ=Asia/Shanghai + - LOG_LEVEL=INFO + - SERVER_HOST=0.0.0.0 + - SERVER_PORT=8000 + - SERVER_WORKERS=1 + - ACCOUNT_STORAGE=local + - ACCOUNT_LOCAL_PATH=data/accounts.db + - FLARESOLVERR_URL=http://flaresolverr:8191 + - CF_REFRESH_INTERVAL=300 + - CF_TIMEOUT=60 + networks: + - default + - traefik + labels: + - traefik.enable=true + - traefik.http.routers.grok2api.rule=Host(`grok2api.imbytecat.com`) + - traefik.http.routers.grok2api.service=grok2api + - traefik.http.services.grok2api.loadbalancer.server.port=8000 + + # warp: + # image: caomingjun/warp:latest + # restart: unless-stopped + # environment: + # - WARP_SLEEP=2 + # cap_add: + # - NET_ADMIN + + microwarp: + image: ghcr.io/ccbkkb/microwarp:latest + restart: unless-stopped + volumes: + - ./volumes/warp:/etc/wireguard + cap_add: + - NET_ADMIN + - SYS_MODULE + sysctls: + - net.ipv4.conf.all.src_valid_mark=1 + + flaresolverr: + image: ghcr.io/flaresolverr/flaresolverr:latest + restart: unless-stopped + environment: + - TZ=Asia/Shanghai + - LOG_LEVEL=info + +networks: + traefik: + external: true