mirror of
https://github.com/harivansh-afk/nix.git
synced 2026-04-19 15:04:47 +00:00
15 lines
571 B
Nix
15 lines
571 B
Nix
{
|
|
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"
|
|
'';
|
|
}
|