Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/takeruhukushima/dotfiles.
Something went wrong. Try again.
Files
- Nix 100%
README.md
dotfiles #
Declarative, multi-OS dotfiles and environment configurations managed by Nix and Home Manager.
🌟 Features #
- Single-file Architecture: 煩雑なディレクトリ分割を避け、
flake.nix1つで全設定を完結させるモダンな構成(flake-parts使用)。 - Multi-OS Support: 共通のパッケージリストを保持しつつ、macOS (Apple Silicon) と Windows (WSL2) の両方にシームレスに対応。
- AI-Ready:
ryoppippi/nix-claude-codeを Flake input として取り込み、常に公式の最新ネイティブバイナリ版 Claude Code を利用可能。
📦 Managed Tools #
- AI Agents:
claude-code,opencode - Core CLI:
git,ripgrep - Environment:
direnv,nix-direnv
🚀 Initial Setup (New Machine) #
新しいPCを買った際の、完全自動セットアップ手順です。事前準備として Git などを手動インストールする必要はありません。OSに合わせて以下の手順を実行してください。
🍎 macOS (Apple Silicon) の場合 #
ターミナルを開き、以下のコマンドを順番に実行します。
1. Nixのインストール
curl --proto '=https' --tlsv1.2 -sSf -L https://install.nixos.org | sh -s -- install
2. リポジトリの取得
nix run nixpkgs#git -- clone https://github.com/takeruhukushima/dotfiles.git ~/dotfiles
cd ~/dotfiles
3. Home Manager の初回構築
nix run nixpkgs#home-manager -- switch --flake .#fukushimatakeru
🪟 Windows (WSL2) の場合 #
1. WSL2 の有効化(事前準備) Windowsの「PowerShell」または「ターミナル」を管理者権限で開き、以下を実行します。
wsl --install
※ 実行後、PCの再起動を求められた場合は再起動してください。再起動後に自動でUbuntuが開きます(ユーザー名とパスワードを設定してください)。
2. Nixのインストール 開いたUbuntuのターミナルで以下を実行します。
curl --proto '=https' --tlsv1.2 -sSf -L https://install.nixos.org | sh -s -- install
3. リポジトリの取得
nix run nixpkgs#git -- clone https://github.com/takeruhukushima/dotfiles.git ~/dotfiles
cd ~/dotfiles
4. Home Manager の初回構築
nix run nixpkgs#home-manager -- switch --flake .#fukushimatakeru-wsl
🔄 Daily Usage #
設定ファイル(flake.nix)に新しいパッケージを追加したり、設定を変更した後の適用手順です。
flake.nixを編集する- 変更を Git にステージングする(※Nix Flakes の仕様上、必須)
git add flake.nix
- 専用の適用コマンドを実行する
nix run .#switch
Note
nix run .#switch は flake.nix 内の apps.switch で定義されたカスタムコマンドです。OSを問わず、一発で Home Manager のビルドと適用を完了させます。