{ ... }:
{
  services.keyd = {
    enable = false;
    keyboards = {
      default = {
        ids = [ "*" ];
        settings = {
          main = {
            # Use ⌘ key (leftmeta) to activate macOS-like layer
            leftmeta = "layer(meta_mac)";
          };

          meta_mac = {
            # Tab switching
            tab = "swapm(app_switch_state, M-tab)";
            "`" = "A-f6";

            # App shortcuts
            c = "C-insert"; # Copy
            v = "S-insert"; # Paste
            x = "S-delete"; # Cut

            "1" = "A-1";
            "2" = "A-2";
            "3" = "A-3";
            "4" = "A-4";
            "5" = "A-5";
            "6" = "A-6";
            "7" = "A-7";
            "8" = "A-8";
            "9" = "A-9";

            # Move to line start/end
            left = "home";
            right = "end";
          };

          app_switch_state = {
            tab = "M-tab";
            right = "M-tab";
            "`" = "M-S-tab";
            left = "M-S-tab";
          };
        };
      };
    };
  };
}
