Home Explore Blog Models CI



nixpkgs

1st chunk of `nixos/modules/i18n/input-method/default.md`
f7b0caea4c881b5db3d468fee4bac12c3c42d15ba547eb370000000100000b54
# Input Methods {#module-services-input-methods}

Input methods are an operating system component that allows any data, such as
keyboard strokes or mouse movements, to be received as input. In this way
users can enter characters and symbols not found on their input devices.
Using an input method is obligatory for any language that has more graphemes
than there are keys on the keyboard.

The following input methods are available in NixOS:

  - IBus: The intelligent input bus.
  - Fcitx5: The next generation of fcitx, addons (including engines, dictionaries, skins) can be added using `i18n.inputMethod.fcitx5.addons`.
  - Nabi: A Korean input method based on XIM.
  - Uim: The universal input method, is a library with a XIM bridge.
  - Hime: An extremely easy-to-use input method framework.
  - Kime: Korean IME

## IBus {#module-services-input-methods-ibus}

IBus is an Intelligent Input Bus. It provides full featured and user
friendly input method user interface.

The following snippet can be used to configure IBus:

```nix
{
  i18n.inputMethod = {
    enable = true;
    type = "ibus";
    ibus.engines = with pkgs.ibus-engines; [
      anthy
      hangul
      mozc
    ];
  };
}
```

`i18n.inputMethod.ibus.engines` is optional and can be used
to add extra IBus engines.

Available extra IBus engines are:

  - Anthy (`ibus-engines.anthy`): Anthy is a system for
    Japanese input method. It converts Hiragana text to Kana Kanji mixed text.
  - Hangul (`ibus-engines.hangul`): Korean input method.
  - libpinyin (`ibus-engines.libpinyin`): A Chinese input method.
  - m17n (`ibus-engines.m17n`): m17n is an input method that
    uses input methods and corresponding icons in the m17n database.
  - mozc (`ibus-engines.mozc`): A Japanese input method from
    Google.
  - Table (`ibus-engines.table`): An input method that load
    tables of input methods.
  - table-others (`ibus-engines.table-others`): Various
    table-based input methods. To use this, and any other table-based input
    methods, it must appear in the list of engines along with
    `table`. For example:

    ```nix
    {
      ibus.engines = with pkgs.ibus-engines; [
        table
        table-others
      ];
    }
    ```

To use any input method, the package must be added in the configuration, as
shown above, and also (after running `nixos-rebuild`) the
input method must be added from IBus' preference dialog.

### Troubleshooting {#module-services-input-methods-troubleshooting}

If IBus works in some applications but not others, a likely cause of this
is that IBus is depending on a different version of `glib`
to what the applications are depending on. This can be checked by running
`nix-store -q --requisites <path> | grep glib`,
where `<path>` is the path of either IBus or an
application in the Nix store. The `glib` packages must
match exactly. If they do not, uninstalling and reinstalling the

Title: NixOS Input Methods and IBus Configuration
Summary
This document introduces input methods as an operating system component crucial for entering characters and symbols not present on physical keyboards, especially for languages with many graphemes. It lists several input methods available in NixOS, including IBus, Fcitx5, Nabi, Uim, Hime, and Kime. The document then focuses on IBus, an Intelligent Input Bus, explaining its purpose and providing a NixOS configuration snippet to enable and add extra IBus engines like Anthy, Hangul, and Mozc. It also lists other available IBus engines such as libpinyin, m17n, Table, and table-others, detailing their use cases. Finally, it offers a troubleshooting tip for IBus issues, suggesting a check for `glib` version mismatches between IBus and other applications.