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 -- installhome-manager switch --flake .#meiリモート環境(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 --impuremei: macOS用フルプロファイル(ローカル開発環境)mei-remote: リモート用軽量プロファイル(EC2/Linux)- 自動的に実行ユーザー名を検出(
ubuntu,ec2-user等) - 最小限のCLIツール + Neovim/LSP + Tmux/Zellij
- SSH接続時に自動的にtmuxセッション起動
- 自動的に実行ユーザー名を検出(
- git, gh, fzf, ripgrep, fd, bat, tree, yazi
- neovim, tmux, zellij
- zoxide, jujutsu, gitui
- LSP: pyright, gopls, rust-analyzer, efm-langserver
- ランタイム: Python(uv), Node.js, Rust, Go, Deno
- ビルドツール: cargo, llvm, sqlite, postgresql
- karabiner, aerospace, yabai(ウィンドウ管理)
- claude-code, terraform, google-cloud-sdk
便利なタスクランナーコマンド(justコマンドが必要)
just update-home # Home Manager設定を適用
just update-darwin # nix-darwin設定を適用
just update-all # すべて更新(flake + home + darwin)
just gc # Nixガベージコレクション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.shGitHub Actionsでプッシュ時に自動実行されます:
- Nix flake構文チェック
- シェルスクリプトlint
- プロファイルのビルドテスト(Ubuntu/macOS)
# シェルを再起動
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