LoginSignup
2

More than 1 year has passed since last update.

Macを買ってやったこと(2022 Apple Silicon編)

Last updated at Posted at 2022-08-06

M2のMacBook Airをポチったので環境構築のメモ。
インストール作業がIntel Macに比べて体感爆速だった。
Intel MacでもRosettaのインストール以外は使えると思う

GUIから

  • Chrome
  • Google Japanese Input
  • Jetbrains Toolbox
  • Visual Studio Code
  • Nerd Font

この辺はBrewとかでもインストールできると思うけど、先にインストールしてしまう。

App Storeから

  • XCode

実行後ConsoleからlicenseにAgreeしておく。

CLI

  • Gitの初期設定
git config --global user.name "Your Name"
git config --global user.email "Your Address"
ssh-keygen -t ed25519
cat ~/.ssh/id_ed25519 | pbcopy # Githubなどに登録しておく
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
softwareupdate --install-rosetta

Homebrewから

開発まわりで使いそうなツールを入れていく

  • dotnet
  • Terraform
  • JDK
  • Helm
  • Skaffold
  • Dapr
  • Go
  • Node.js
  • Github CLI
brew install zsh-completions
# Modify zshrc
source ~/.zshrc
rm -f ~/.zcompdump; compinit
brew install zsh-autosuggestions
brew install --cask docker
brew install --cask devtoys
brew install --cask corretto
brew install helm
brew install skaffold
brew install --cask dotnet-sdk
brew install mono-libgdiplus # https://docs.microsoft.com/en-us/dotnet/core/install/macos#libgdiplus
brew install terraform
brew install golang
brew install node
arch -arm64 brew install dapr/tap/dapr-cli
brew install gh

ZSHRCのファイルの中身

```zsh
zstyle ":completion:*:commands" rehash 1

typeset -U path PATH
path=(
  /opt/homebrew/bin(N-/)
  /opt/homebrew/sbin(N-/)
  /usr/bin
  /usr/sbin
  /bin
  /sbin
  /usr/local/bin(N-/)
  /usr/local/sbin(N-/)
  /Library/Apple/usr/bin
  '/Users/narachannel/Library/Application Support/JetBrains/Toolbox/scripts'
)

export GOPATH=$HOME/go
export GOROOT="$(brew --prefix golang)/libexec"
export PATH="$PATH:${GOPATH}/bin:${GOROOT}/bin"
plugins=(git brew kubectl history-substring-search)

alias code="code-insiders"
alias k="kubectl"
alias python="python3"
alias pip="pip3"

ZSH_THEME="powerlevel10k/powerlevel10k"

#ZSH Autocomplete
if type brew &>/dev/null; then
  FPATH=$(brew --prefix)/share/zsh-completions:$FPATH
  source $(brew --prefix)/share/zsh-autosuggestions/zsh-autosuggestions.zsh
  source <(kubectl completion zsh)
  autoload -Uz compinit
  compinit
fi

参考、はまった事とか

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2