nix-community / home-manager

Manage a user environment using Nix [maintainer=@rycee]
https://nix-community.github.io/home-manager/
MIT License
7.14k stars 1.85k forks source link

bug: `targets.darwin.keybindings` not generating correct output? #6120

Open ok-nick opened 4 days ago

ok-nick commented 4 days ago

Are you following the right branch?

Is there an existing issue for this?

Issue description

Hi, I'm having trouble using the targets.darwin.keybindings setting. It doesn't work with the home-manager generated output, but it does when I convert it to a different format as shown below.

Using the settings:

targets.darwin.keybindings = {
  # ctrl + left arrow
  "^\\UF702" = "moveWordBackward:";
  # ctrl + right arrow
  "^\\UF703" = "moveWordForward:";
};

Generates the following output:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>^\UF702</key>
    <string>moveWordBackward:</string>
    <key>^\UF703</key>
    <string>moveWordForward:</string>
</dict>
</plist>

Which doesn't work. If I set the file content to:

{
    "^\UF702" = "moveWordBackward:";
    "^\UF703" = "moveWordForward:";
}

It works perfectly fine. Is the wrong type of output being generated?

Maintainer CC

No response

System information

/nix/store/0c5hnhrh7sb6gsz1rjka2zhv48sfp9wf-stdenv-darwin
copying path '/nix/store/0c5hnhrh7sb6gsz1rjka2zhv48sfp9wf-stdenv-darwin' from 'https://cache.nixos.org'...
 - system: `"aarch64-darwin"`
 - host os: `Darwin 24.1.0, macOS 15.1`
 - multi-user?: `yes`
 - sandbox: `no`
 - version: `nix-env (Nix) 2.24.9`
 - channels(root): `"nixpkgs"`
 - nixpkgs: `/nix/store/zq2axpgzd5kykk1v446rkffj3bxa2m2h-source`