This website requires JavaScript.
0
Issues
Pull Requests
Milestones
Explore
0
Create…
New Repository
New Migration
New Organization
admin
Signed in as
admin
Profile
Starred
Subscriptions
Settings
Help
Site Administration
Sign Out
admin
/
homelab
Watching
1
Participating and mentions
Receive notifications from this repository when participating or mentioned.
All activity
Receive notifications for all events.
Ignore
Never receive notifications from this repository.
Custom
Select events you want to be notified of, in addition to participating and mentions.
Star
0
Fork
0
Notifications
Issues
Pull Requests
Releases
Cancel
Confirm
Code
Issues
Pull Requests
Actions
Packages
Projects
Releases
Wiki
Activity
Settings
Files
homelab
/
scripts
/
or
Cancel
Edit File
Preview
Preview Changes
Spaces
Tabs
2
4
8
Wrap
No wrap
#!/usr/bin/env bash # ============================================================================== # 01-macmini-init.sh # 用途:Mac mini (M6) 家庭 All-in-One 服务器底座初始化脚本 # 包含:电源防休眠配置、标准目录初始化、Homebrew + OrbStack + 常用开发工具安装 # ============================================================================== set -euo pipefail echo ">>> [1/4] 创建标准服务器目录结构 (~/homelab & ~/workspace)..." mkdir -p "$HOME/homelab/stacks/{lucky,tailscale,monitoring}" mkdir -p "$HOME/homelab/scripts" mkdir -p "$HOME/homelab/backups" mkdir -p "$HOME/workspace" echo ">>> [2/4] 配置 macOS 服务器电源管理策略 (pmset: 永不休眠 + 断电自启 + 网络唤醒)..." sudo pmset -a \ sleep 0 \ disksleep 0 \ displaysleep 10 \ standby 0 \ autorestart 1 \ womp 1 \ tcpkeepalive 1 \ powernap 1 pmset -g echo ">>> [3/4] 检查并安装 Homebrew..." export PATH="/opt/homebrew/bin:/usr/local/bin:$PATH" if ! command -v brew >/dev/null 2>&1; then echo "正在安装 Homebrew..." NONINTERACTIVE=1 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" if ! grep -q '/opt/homebrew/bin/brew' "$HOME/.zprofile" 2>/dev/null; then echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> "$HOME/.zprofile" fi eval "$(/opt/homebrew/bin/brew shellenv)" else echo "Homebrew 已安装: $(brew --version | head -n 1)" fi echo ">>> [4/4] 安装容器底座 (OrbStack)、组网工具 (Tailscale) 与远程开发工具链..." brew install --cask orbstack tailscale-app brew install git tmux btop ripgrep fd jq wget fnm uv echo "✅ Mac mini 基础底座初始化完成!"
Commit Changes
Add a Signed-off-by trailer by the committer at the end of the commit log message.
Commit directly to the
main
branch.
Create a
new branch
for this commit and start a pull request.
Commit Changes
Cancel