Skip to content

makoto-developer/pc-setup

Repository files navigation

macOS開発環境構築

iterm2をインストール

ここ↓からitem2をインストール

https://iterm2.com/

※macOS純正のterminalはbrewがうまく機能しない場合があるのでiterm2を使う

brewをインストール

ここ↓からbrewをインストールするか、コマンドでインストール

https://brew.sh/

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

作業ディレクトリを作成しておく

mkdir -p ~/work/github ~/work/gitlab ~/opt ~/tmp
  • ~/workはGithubや個人開発のプロジェクトを管理する領域
  • ~/opt -> Go製のコマンドなど、手動でダウンロードしてローカルで使う時に配置するディレクトリ
  • ~/tmp -> 中間ファイルや一時的な作業場でいつでも消えて問題ないディレクトリ

必要なツールをインストール

方針

  • ツールは可能な限りbrewでインストール
  • プログラミング言語はasdfで管理
    • 例外として、バージョンを揃えた方がいいツールはasdf
  • brewでインストールする前に必ずhomebrewホームページを見て開発元を確認 -> https://brew.sh/ja/

caskでインストール可能なappの一覧はこちら -> https://github.com/Homebrew/homebrew-cask/tree/master/Casks

必須アプリ

brew install --cask google-chrome
brew install --cask  google-japanese-ime
brew install --cask  clipy
brew install --cask  alt-tab
brew install --cask  rectangle
brew install --cask  karabiner-elements
brew install --cask  jetbrains-toolbox
brew install --cask  visual-studio-code
brew install --cask  chromium
brew install --cask  notion
brew install --cask  discord
brew install --cask  openlens
brew install --cask  postman

必要であれば入れるアプリ

brew install --cask warp
brew install --cask slack
brew install --cask itsycal
brew install --cask figma
brew install --cask kindle
brew install --cask skype
brew install --cask zoom
brew install --cask wireshark
brew install --cask microsoft-excel
brew install --cask microsoft-office
brew install --cask microsoft-openjdk
brew install --cask microsoft-outlook
brew install --cask microsoft-powerpoint
brew install --cask microsoft-remote-desktop
brew install --cask microsoft-teams
brew install --cask microsoft-word
brew install --cask android-file-transfer

Caskで入らないアプリ

Google Drive (https://workspace.google.com/products/drive/#download)
One Drive(https://www.microsoft.com/ja-jp/microsoft-365/onedrive/online-cloud-storage)

コマンド

brew install nvim
# 履歴から使いたいコマンドを呼び起こす(Fishで困っていないから使ってない)
#brew install peco
# git cui client(標準で十分なので使ってない)
#brew install tig
# lessの代替(lessでええやん)
#brew install bat

ghqの設定で必要なコマンド

brew install ghq fzf hstr

Google Driveを入れる

インターネットでGoogle Drive macOSで検索してインストール。同期してバックアップファイルを取得する。

セキュリティソフト

必要なら入れる

開発用のフォントをインストール

こちら↓を参照

https://github.com/yuru7/HackGen

brew tap homebrew/cask-fonts
brew install font-hackgen font-hackgen-nerd

power fontをインストール(preztoのテーマの設定で必要になるの今のうちに入れる)

  1. 公式↓を参考にインストール

https://github.com/powerline/fonts

git clone https://github.com/powerline/fonts.git --depth=1

cd fonts
./install.sh

cd ..
rm -rf fonts
  1. poworline-shellをインストール

https://github.com/b-ryan/powerline-shell

[!TIP] asdf install python 3.9.18でインストールしたのち、python setup.py installを実行。 macos m1だpython v2系がなくなったので手順書通りやってもできない可能性が高い。

Gitのバージョンを上げる

こちら↓を参考に

https://qiita.com/normalsalt/items/f200ba50363ebfd46df0

brew install git

sshを設定

$ brew install git-delta
$ cd ~
$ mkdir .ssh
$ cd .ssh
$ ssh-keygen -t ed25519 -C "GitHub(makoto-developer)" -f ~/.ssh/id_github_20251006_ed25519

# Generating public/private ed25519 key pair.
# Enter file in which to save the key (/Users/user/.ssh/id_ed25519): id_github <<<githubを例に。ドメインごとにsshkeyを作成する。流用しない。>>>
# Enter passphrase (empty for no passphrase): <<<パスフレーズを設定(Githubでは設定することを推奨している)>>>
# Enter same passphrase again: <<<パスフレーズを設定(Githubでは設定することを推奨している)>>>
# Your identification has been saved in id_github
# Your public key has been saved in id_github.pub
# The key fingerprint is:
# The key's randomart image is:
# +--[ED25519 256]--+
# |                 |
# |                 |
# |                 |
# |                 |
# |                 |
# |                 |
# |             ..  |
# +----[SHA256]-----+

# コピーしてsshキーをgithubに登録
pbcopy < ~/.ssh/id_github_20251006_ed25519.pub
# ssh configを設定
touch ~/.ssh/config

vi ~/.ssh/config
# 中身は↓のように
Host github.com
  HostName github.com
  User <<<your name>>>
  Port 22
  IdentityFile ~/.ssh/id_github_20251006_ed25519
  IdentitiesOnly yes

# 疎通確認
ssh -T git@github.com

# パスフレーズの入力を省略
ssh-add -K ~/.ssh/id_github_20251006_ed25519

# 登録できたか確認
ssh-add -l

dotfilesを取得して、READMEに従って設定する

git clone git@github.com:makoto-developer/dotfiles.git

# README.mdをみて設定をする

iterm

itermのprofileから↓のパスの設定ファイルをimportする

~/dotfiles/iterm/

cmd + enterで最大化しないようにする

Keys -> Key Bindings -> +ボタン -> 'CMD + ENTER' is disabled`

itermのフォントをpowerlineのフォントに変更しておく

itermを開いて profiles -> text -> font -> 「power」がつくフォントを選ぶ

キーリピート設定変更

入力速度を速くする

defaults write -g InitialKeyRepeat -int 11
defaults write -g KeyRepeat -int 1
# 緊急時、元に戻すコマンド
defaults delete -g InitialKeyRepeat
defaults delete -g KeyRepeat

Fish shell

参考: https://zenn.dev/sawao/articles/0b40e80d151d6a

brew install fish
echo /usr/local/bin/fish | sudo tee -a /etc/shells
chsh -s /usr/local/bin/fish

# fish shell configを作成
mv ~/.config/fish/config.fish ~/.config/fish/config.fish.org
mv ~/.config/fish/conf.d ~/.config/fish/conf.d.org
ln -s ~/dotfiles/fish/config.fish ~/.config/fish/
ln -s ~/dotfiles/fish/init.fish ~/.config/fish/
ln -s ~/dotfiles/fish/conf.d  ~/.config/fish/

バージョン管理ツール

brew install mise

install

cd ~
# https://github.com/makoto-developer/dotfilesを参照
ln -s ~/dotfiles/asdf/.tool-versions ~
mise i

動作確認

以下のコマンドが使えるかチェック

iex version
erl version
node -v
go version
rustc -V

Elixir Phoenix インストール

公式サイトを参考にインストールする(https://hexdocs.pm/phoenix/installation.html)

mix archive.install hex phx_new

コマンドが使えるか確認

mix

chromeの拡張で入れているもの

脆弱性が心配なのでほとんど何も入れてない

Rancher DeskTopを入れる

lima やめた Rancher Desktopが便利(.docker_lima.mdに移動)

まずはdockerを入れる

brew install docker docker-compose

Rancher DeskTopをインストール

brew install --cask rancher

Non-Commercial(非商用利用)であればDocker Desktopで問題ない

brew install --cask docker

macOS Systemの設定

  • 言語を英語(US)に変更する
  • ファイヤーウォールをONにする
  • Caps Lockをctrlに変更する
  • 時間
    • 秒を表示する
    • 24時間表示にする
  • メニューバーにバッテリーの残量を表示する
  • メニューバーにボリュームを表示する
  • siriは無効化する
  • Mission Controlにある使わないアプリはひとつにまとめて削除
  • ホットコーナーを無効化する
  • spotlight
    • アプリケーションとシステム環境設定以外はすべて無効化
    • ショートカットをctrl + spaceに変更
  • キーボード
    • 数字の全角入力をオフにする
    • シングルクォーテーション、ダブルクオーテーションの自動変換をオフにする
    • スペルの自動変換をオフにする

About

macOSの環境構築

Resources

Stars

Watchers

Forks