使用 Nix 管理 dotfiles
scutil --get LocalHostName
nix --experimental-features 'nix-command flakes' run nix-darwin -- switch --flake .
mv /etc/zshrc /etc/bashrc.before-nix-darwin
)darwin-rebuild switch --flake .
access-tokens
(~/.config/nix/nix.conf
),之后在非 sudo 环境遇到 (Bad credentials
),之后删除 access-tokens
才行。原因是配置的 token 设置了有效期。darwin-system.drv
被删除,darwin-rebuild
失败,必须再次安装 nix-darwin
。
sudo nix-collect-garbage -d
导致
openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/:$//'
sudo /System/Library/PrivateFrameworks/Apple80211.framework/Resources/airport -z
ifconfig en0 ether
# Change the MAC address 14:7d:da:a9:a8:8c(mbp)/84:8c:8d:b1:22:26(router)
sudo ifconfig en0 ether d8:18:fd:c0:41:96
networksetup -detectnewhardware
# Turn off the Wi-Fi device:
networksetup -setairportpower en0 off