Skip to content

[codex] replace Karabiner with Kanary - #893

Merged
keito4 merged 1 commit into
mainfrom
codex/use-kanary-keyboard-remapping
Jun 28, 2026
Merged

[codex] replace Karabiner with Kanary#893
keito4 merged 1 commit into
mainfrom
codex/use-kanary-keyboard-remapping

Conversation

@keito4

@keito4 keito4 commented Jun 28, 2026

Copy link
Copy Markdown
Owner

Summary

  • Replace repo-managed Karabiner configuration with a Kanary-based keyboard remapping decision.
  • Stop installing karabiner-elements and stop importing/deploying nix/home/karabiner.nix.
  • Add a nix-darwin system.checks guard that fails before Homebrew activation if Kanary.app is not installed in /Applications or ~/Applications.
  • Document Kanary setup in ADR 0016 and update tests/tool catalog accordingly.

Impact

darwin-rebuild switch --flake ~/develop/github.com/keito4/config/nix no longer installs or manages Karabiner. Kanary remains a manual install from https://kanary.download/download until a stable package-manager source exists, but rebuild now fails before Homebrew cleanup if Kanary is missing so keyboard remapping does not silently disappear.

Validation

  • npm test -- --runTestsByPath test/nix-darwin-config.test.js
  • npm run format:check
  • nix eval ./nix#darwinConfigurations.keitos-MacBook-Pro.config.system.checks.text

Summary by CodeRabbit

  • New Features

    • Added support for a new keyboard remapping workflow on macOS, including a built-in check that alerts you if the required app is missing.
    • Updated the documented tool list to include the new remapping app.
  • Bug Fixes

    • Removed the previous remapping setup from the default configuration and related package list.
    • Updated configuration checks and tests to reflect the new macOS remapping behavior.

@coderabbitai

coderabbitai Bot commented Jun 28, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

Karabiner Elements is removed as the keyboard remapping tool. The karabiner.nix home-manager module and the karabiner-elements Homebrew cask are deleted. A new nix/modules/kanary.nix module is added that checks for Kanary.app presence at build time. ADR 0016 records this decision; ADR 0014 is marked superseded.

Changes

Karabiner → Kanary migration

Layer / File(s) Summary
Nix module wiring: remove Karabiner, add Kanary check
nix/modules/kanary.nix, nix/hosts/darwin/default.nix, nix/home/default.nix, nix/modules/homebrew.nix
New kanary.nix module adds a system.checks.text shell snippet that exits with code 2 if Kanary.app is missing. Darwin host imports kanary.nix before homebrew.nix. karabiner.nix is removed from home-manager imports and karabiner-elements is removed from Homebrew casks.
ADR 0016 and updated index/catalog
docs/adr/0016-use-kanary-for-keyboard-remapping.md, docs/adr/0014-manage-cmux-karabiner-with-home-manager.md, docs/adr/README.md, docs/tool-catalog.md
ADR 0016 added documenting the Kanary decision with installation steps and removed cmux IME mappings. ADR 0014 status updated to superseded. README index and tool catalog updated to reflect Kanary in place of Karabiner.
Tests updated for Kanary
test/nix-darwin-config.test.js
Tests assert kanary.nix is imported before homebrew.nix, karabiner.nix is absent from home-manager, karabiner-elements cask is not present, and kanary.nix contains expected system check content and app references.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • keito4/config#879: Adds cmux IME shortcut fallback and input-source selection scripts in nix/home/karabiner.nix, the exact module this PR removes.

Poem

🐇 Hop hop, Karabiner's gone away,
Kanary sings a remapping hooray!
A shell check guards the .app in place,
No JSON rules to manage or trace.
The rabbit types with Kanary's grace~ 🎹

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately reflects the Karabiner-to-Kanary migration.
Description check ✅ Passed The description covers summary, impact, and validation steps, with only some template sections left unfilled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/use-kanary-keyboard-remapping

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

test/nix-darwin-config.test.js

Oops! Something went wrong! :(

ESLint: 10.5.0

ReferenceError: describe is not defined
at Object. (/test/eslint-config.test.js:35:1)
at Module._compile (node:internal/modules/cjs/loader:1830:14)
at Object..js (node:internal/modules/cjs/loader:1961:10)
at Module.load (node:internal/modules/cjs/loader:1553:32)
at Module._load (node:internal/modules/cjs/loader:1355:12)
at wrapModuleLoad (node:internal/modules/cjs/loader:255:19)
at loadCJSModuleWithModuleLoad (node:internal/modules/esm/translators:326:3)
at ModuleWrap. (node:internal/modules/esm/translators:231:7)
at ModuleJob.run (node:internal/modules/esm/module_job:437:25)
at async node:internal/modules/esm/loader:639:26


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@keito4
keito4 force-pushed the codex/use-kanary-keyboard-remapping branch from d3d6c1d to 1b1fbfb Compare June 28, 2026 00:31
@keito4
keito4 force-pushed the codex/use-kanary-keyboard-remapping branch from 1b1fbfb to 11b20fa Compare June 28, 2026 00:37
@keito4
keito4 marked this pull request as ready for review June 28, 2026 04:43
@claude

claude Bot commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

Claude finished @keito4's task in 0s —— View job


I'll analyze this and get back to you.

@keito4
keito4 merged commit a223565 into main Jun 28, 2026
18 of 19 checks passed
@keito4
keito4 deleted the codex/use-kanary-keyboard-remapping branch June 28, 2026 04:45
github-actions Bot added a commit that referenced this pull request Jun 28, 2026
最新のmainブランチ(PR #893 でKarabiner→Kanary置換済み)の変更を取り込み
マージコンフリクトを解消する。

- nix/home/karabiner.nix を削除(Kanaryに置換済み)
- nix/home/default.nix からkarabiner.nixのインポートを削除
- nix/hosts/darwin/default.nix にkanary.nixのインポートを追加
- nix/modules/homebrew.nix からkarabiner-elementsを削除
- nix/modules/kanary.nix を追加(Kanary要件チェック)
- docs/adr/0016-use-kanary-for-keyboard-remapping.md を追加
- script/macos/agent-select-input-source.sh を復元
- script/macos/select-input-source.swift を復元
- test/nix-darwin-config.test.js をKanary対応バージョンに更新

Co-authored-by: keito4 <keito4@users.noreply.github.com>
@github-actions

github-actions Bot commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 1.119.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released リリース済み

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant