git clone https://github.com/mei28/dotfiles.git
cd dotfiles
./setup.shcurl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- installユーザー設定(home-manager)とシステム設定(nix-darwin)を別々に適用します。
# ユーザー設定(CLI ツール、shell、neovim 等)
just update-home
# システム設定(/etc, launchd, homebrew, フォント等)— root 必要
sudo just update-darwin
# まとめて: flake 更新 + home + darwin
just update-allリモート環境(EC2インスタンス等)で軽量な開発環境をセットアップします。
以下のワンコマンドでセットアップが完了します:
curl -sSL https://raw.githubusercontent.com/mei28/dotfiles/main/remote-bootstrap.sh | bashこのスクリプトは以下を自動的に実行します:
- Nixのインストール
- dotfilesのクローン
- home-managerの適用(リモートプロファイル)
セットアップ完了後:
exec bash # シェルを再読み込み
tmux # tmuxセッション開始# 1. dotfilesクローン
git clone https://github.com/mei28/dotfiles.git ~/dotfiles
cd ~/dotfiles
# 2. Nixインストール
curl --proto '=https' --tlsv1.2 -sSf -L \
https://install.determinate.systems/nix | sh -s -- install
# 3. home-manager適用(リモートプロファイル)
nix run home-manager/master -- switch --flake .#mei-remote --impureリモート環境で設定を更新する場合:
cd ~/dotfiles
git pull
home-manager switch --flake .#mei-remote --impurehome-manager:
mei: macOS 用フルプロファイル(ローカル開発環境)mei-remote: リモート用軽量プロファイル(EC2/Linux)- 自動的に実行ユーザー名を検出(
ubuntu,ec2-user等) - 最小限の CLI ツール + Neovim/LSP + Tmux
- SSH 接続時に自動的に tmux セッション起動
- 自動的に実行ユーザー名を検出(
nix-darwin:
mei-darwin: macOS システム設定(/etc、launchd、homebrew、フォント等)
実体は .config/nix/home-manager/profiles/{base,development,macos,remote}.nix と .config/nix/nix-darwin/config/homebrew.nix を参照。
- CLI: gh, bat, just, fd, ripgrep, dust, delta, tldr, csvlens, miniserve, serie
- ファイル管理: yazi, trash-cli, tree, wget, curl, zip, unzip
- エディタ/セッション: neovim, tmux, tmux-mem-cpu-load
- shell 補助 (programs.* 経由): bash, fzf, zoxide, fastfetch
- VCS: git, gitui, jujutsu
- LSP: pyright, gopls, rust-analyzer, efm-langserver
- ランタイム: Python (uv), Node.js (nodejs_24, bun, pnpm, ni, deno), Rust (cargo, rustc), Go, Lua (luajit, luarocks)
- ビルド/フォーマッタ: cargo-generate, llvm, sqlite, postgresql, nixfmt-rfc-style, ruff
- 自作ツール: cliperge, sgh, portsage, git-gardener, bonsai
- メディア: ffmpeg, ffmpegthumbnailer, imagemagick, ghostscript, marp-cli
- クラウド/IaC: google-cloud-sdk, terraform, heroku
- その他: claude-code, tree-sitter, git-lfs, openssl, arxiv-latex-cleaner
- ウィンドウ管理: aerospace, hammerspoon
- ターミナル: wezterm, wezterm@nightly, ghostty
- ランチャー/ユーティリティ: raycast, marta, ngrok, azookey, thaw
- フォント: font-hack-nerd-font, font-symbols-only-nerd-font
便利なタスクランナーコマンド(justコマンドが必要)
just update-home # Home Manager 設定を適用
just update-darwin # nix-darwin 設定を適用(root 必要 → sudo 経由で呼ぶ)
just update-flake # flake.lock を更新
just update-all # すべて更新(flake + home + darwin)
just build-home # 適用せずビルドだけ(事前検証)
just eval-home # 構文/参照のみ評価(高速チェック)
just gc # Nix ガベージコレクション
just delete-old-profiles # 古い世代を削除just remote-apply # リモートプロファイルを適用
just remote-update # flake更新 + リモートプロファイル適用
just remote-test # リモート設定のビルドテスト(dry-run)just check # Nix flakeの構文チェック
just fmt # Nixファイルのフォーマット
just lint-shell # シェルスクリプトのlint(shellcheck)
just test-docker-ubuntu # Ubuntu Dockerでテスト
just test-docker-amazon # Amazon Linux Dockerでテスト
just test-all # すべてのテストを実行just info # 現在の設定情報を表示
just clean # ビルド成果物をクリーンアップローカル環境を汚さずにテストできます:
# Ubuntu環境でテスト
just test-docker-ubuntu
# Amazon Linux環境でテスト
just test-docker-amazonまたは直接:
# Ubuntu
docker build -f test/Dockerfile.ubuntu -t dotfiles-test-ubuntu .
docker run --rm -it dotfiles-test-ubuntu
# Amazon Linux
docker build -f test/Dockerfile.amazonlinux -t dotfiles-test-amazon .
docker run --rm -it dotfiles-test-amazonセットアップ後に正しくインストールされたか確認:
bash test/verify-setup.sh- EC2インスタンスを起動(Ubuntu 22.04 または Amazon Linux 2023)
- SSHで接続
- Bootstrapスクリプトを実行:
curl -sSL https://raw.githubusercontent.com/mei28/dotfiles/main/remote-bootstrap.sh | bash- 検証:
exec bash
bash ~/dotfiles/test/verify-setup.sh.github/workflows/ci.yml で push / PR 時に自動実行:
nix flake check --impureと nixfmt フォーマットチェックshellcheck(remote-bootstrap.sh,test/verify-setup.sh)mei-remoteプロファイルのビルド(ubuntu-latest)remote-bootstrap.shの構文 + 必須コマンド検査
# シェルを再起動
exec bash
# または新しいシェルセッションを開くcd ~/dotfiles
just remote-applyrm -rf ~/dotfiles ~/.local/state/nix/profiles/home-manager
curl -sSL https://raw.githubusercontent.com/mei28/dotfiles/main/remote-bootstrap.sh | bash