karabiner udpate to option key rather than ctr

This commit is contained in:
Harivansh Rathi 2026-03-28 18:23:59 -04:00
parent 302a4ef959
commit 91da419306
2 changed files with 24 additions and 13 deletions

View file

@ -1,4 +1,15 @@
{...}: {
xdg.configFile."karabiner/karabiner.json".source =
../config/karabiner/karabiner.json;
{
config,
lib,
...
}: {
# Karabiner-Elements destroys symlinks (unlink + rewrite), so we cannot use
# xdg.configFile. Instead, copy the file on every activation so Karabiner
# sees a real mutable file whose contents match our nix-managed source.
home.activation.karabinerConfig = lib.hm.dag.entryAfter ["writeBoundary"] ''
karabiner_dir="${config.home.homeDirectory}/.config/karabiner"
mkdir -p "$karabiner_dir"
cp -f "${../config/karabiner/karabiner.json}" "$karabiner_dir/karabiner.json"
chmod 600 "$karabiner_dir/karabiner.json"
'';
}