{"id":51472714,"url":"https://github.com/forest1102/dotfiles","last_synced_at":"2026-07-06T19:30:42.008Z","repository":{"id":369406669,"uuid":"1278915254","full_name":"forest1102/dotfiles","owner":"forest1102","description":null,"archived":false,"fork":false,"pushed_at":"2026-07-05T05:54:19.000Z","size":42,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-07-05T07:12:35.079Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/forest1102.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-24T07:52:32.000Z","updated_at":"2026-07-05T05:54:22.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/forest1102/dotfiles","commit_stats":null,"previous_names":["forest1102/dotfiles"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/forest1102/dotfiles","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forest1102%2Fdotfiles","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forest1102%2Fdotfiles/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forest1102%2Fdotfiles/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forest1102%2Fdotfiles/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/forest1102","download_url":"https://codeload.github.com/forest1102/dotfiles/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forest1102%2Fdotfiles/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35204409,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-06T02:00:07.184Z","response_time":106,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-07-06T19:30:41.872Z","updated_at":"2026-07-06T19:30:41.984Z","avatar_url":"https://github.com/forest1102.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dotfiles\n\nmacOS 用の Nix / nix-darwin / Home Manager 設定です。\n\nこの flake は `USER` / `SUDO_USER` / `HOSTNAME` / `SYSTEM` を評価時に参照するため、コマンドには `--impure` を付けます。flake 出力は基本的に `.#default` を使います。\n\n## Nix のインストール\n\nmacOS では公式の multi-user installer を使います。\n\n```sh\ncurl --proto '=https' --tlsv1.2 -L https://nixos.org/nix/install | sh\n```\n\nインストール後はターミナルを開き直して、Nix が使えることを確認します。\n\n```sh\nnix --version\n```\n\n## 初回セットアップ\n\n`darwin-rebuild` がまだ PATH にない場合は、`nix run` で nix-darwin を実行して初回適用します。\n\n```sh\nsudo nix --extra-experimental-features \"nix-command flakes\" run github:nix-darwin/nix-darwin/master#darwin-rebuild -- switch --flake .#default --impure\n```\n\n## 設定の反映\n\nmacOS 全体の設定と Home Manager の設定をまとめて反映します。\n\n```sh\nsudo darwin-rebuild switch --flake .#default --impure\n```\n\n反映前にビルドだけ確認する場合は次を使います。\n\n```sh\ndarwin-rebuild build --flake .#default --impure\n```\n\nHome Manager だけを反映したい場合は次を使います。\n\n```sh\nhome-manager switch --flake .#default --impure\n```\n\n## Nix の基本操作\n\nflake の出力を確認します。\n\n```sh\nnix flake show --impure\n```\n\n依存関係を更新します。\n\n```sh\nnix flake update\n```\n\nNix ファイルを整形します。\n\n```sh\nnix fmt\n```\n\n## Claude / Codex 設定\n\nClaude と Codex の移植可能な個人設定は、このリポジトリから `ai-agents-sync` コマンドで同期します。Home Manager は同期コマンドだけをインストールし、AI 関連の設定ファイルやメモリー本体は自動更新しません。\n\n- 共通メモリ: `modules/home/ai-agents/shared-memory.md`\n- Codex: `~/.codex/config.toml` と `~/.codex/AGENTS.md`\n- Claude: `~/.claude/settings.json` と `~/.claude/CLAUDE.md`\n\n共有するのはモデル、権限、プラグイン有効化、共通指示などの再生成できる設定だけです。認証情報、履歴、セッション、キャッシュ、SQLite DB、自動生成メモリは各 Mac のローカル状態として残します。\n\n設定を反映するときだけ、次のコマンドを実行します。既存ファイルの内容が変わる場合は `*.backup.YYYYMMDDHHMMSS` に退避してから上書きするため、固定名の `backup` ファイル衝突で失敗しません。\n\n```sh\nai-agents-sync\n```\n\nプラグイン本体の初回インストールや Google / GitHub / Gmail / Slack などの外部サービス認証は各 Mac で実行します。\n\n## nvw\n\n`nvw` は git worktree を作成または開いて、そのディレクトリを Neovim で開くコマンドです。Home Manager の `home.packages` からインストールされます。\n\n```sh\nnvw \u003cbranch\u003e [base-ref]\n```\n\n例:\n\n```sh\nnvw feature/example\nnvw feature/example origin/main\n```\n\n`base-ref` を省略した場合は `HEAD` を使います。既に同名の worktree ディレクトリがある場合は作成せず、そのディレクトリをそのまま Neovim で開きます。\n\nNeovim 内からは remote plugin 経由で同じ作成処理を呼び出せます。\n\n```vim\n:Nvw \u003cbranch\u003e [base-ref]\n:WorktreeCreate \u003cbranch\u003e\n```\n\n`\u003cleader\u003ewc` も `:Nvw` と同じ Rust 実装を使います。remote plugin host は Home Manager が生成する `nvw-rplugin` から起動され、通常は直接実行しません。\n\nworktree はメイン worktree の直下にある `.worktree` ディレクトリへ作成されます。branch 名の `/` や空白は `-` に置き換えられます。\n\n```text\n\u003cmain-worktree\u003e/.worktree/\u003csanitized-branch\u003e\n```\n\nbranch が既に存在する場合:\n\n```sh\ngit worktree add \u003cworktree-path\u003e \u003cbranch\u003e\n```\n\nbranch が存在しない場合:\n\n```sh\ngit worktree add -b \u003cbranch\u003e \u003cworktree-path\u003e \u003cbase-ref\u003e\n```\n\n`.worktree/init.sh` がある場合は、worktree 作成後にそのディレクトリで実行します。init script には次の環境変数が渡されます。\n\n```text\nWORKTREE_MAIN_ROOT=\u003cmain-worktree\u003e\nWORKTREE_PATH=\u003cworktree-path\u003e\nWORKTREE_BRANCH=\u003cbranch\u003e\nWORKTREE_BASE=\u003cbase-ref\u003e\n```\n\n## nvim-git-changes\n\n`nvim-git-changes` は Neovim の `:GitChangedFiles` 用 remote plugin です。`nvw` とは別の Rust crate として管理し、git の変更一覧取得、porcelain v2 の解析、`HEAD:\u003cfile\u003e` の内容取得だけを担当します。\n\nNeovim 側の Snacks picker、diff window、keymap は Lua 設定に残します。Rust 側は非同期 remote function として呼び出され、完了時に Lua の受信関数へ結果を返します。\n\n```vim\n:GitChangedFiles\n:GitChangedFilesClose\n```\n\n`\u003cleader\u003ege` も `:GitChangedFiles` と同じ表示を切り替えます。変更一覧では `M` / `A` / `D` / `R` / `??` の短い状態ラベルを表示し、rename は `old -\u003e new` として扱います。\n\n## GitHub SSH キー\n\nHome Manager の activation 時に `~/.ssh/id_ed25519` が無ければ、GitHub 用の初期 SSH キーを生成します。既に `~/.ssh/id_ed25519` がある場合、その秘密鍵は上書きしません。\n\n公開鍵は次のコマンドで確認できます。\n\n```sh\ncat ~/.ssh/id_ed25519.pub\n```\n\n表示された公開鍵を GitHub の SSH keys 設定に登録します。\n\n```text\nGitHub \u003e Settings \u003e SSH and GPG keys \u003e New SSH key\n```\n\n登録後、接続確認は次のコマンドで行います。\n\n```sh\nssh -T git@github.com\n```\n\n## フォント設定\n\nフォントは `modules/darwin/default.nix` の `fonts.packages` で管理します。現在は FiraCode Nerd Font を入れています。\n\n```nix\nfonts.packages = with pkgs; [\n  nerd-fonts.fira-code\n];\n```\n\nフォントを追加したい場合は、このリストに package を追加してから `darwin-rebuild switch` を実行します。\n\nNix でフォントをインストールした後、実際に使うフォントは各アプリ側で選びます。macOS 標準機能ではシステム UI 全体のフォント変更は扱いません。\n\n```text\nTerminal.app:\n設定 \u003e プロファイル \u003e テキスト \u003e フォント \u003e 変更 \u003e FiraCode Nerd Font\n\niTerm2:\nSettings \u003e Profiles \u003e Text \u003e Font \u003e FiraCode Nerd Font\n\nVS Code:\nSettings \u003e Editor: Font Family に 'FiraCode Nerd Font' を追加\n```\n\n## 参考\n\n- [Nix download](https://nixos.org/download/)\n- [nix-darwin README](https://github.com/nix-darwin/nix-darwin)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fforest1102%2Fdotfiles","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fforest1102%2Fdotfiles","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fforest1102%2Fdotfiles/lists"}