{ config, lib, pkgs, ... }: let cfg = config.sydnix.users.crumb.fcitx5; in { options.sydnix.users.crumb.fcitx5 = { enable = lib.mkEnableOption "fcitx5 input method"; }; config = lib.mkIf cfg.enable { i18n.inputMethod = { enable = true; type = "fcitx5"; fcitx5 = { waylandFrontend = true; addons = [ pkgs.fcitx5-gtk pkgs.fcitx5-table-other pkgs.libsForQt5.fcitx5-chinese-addons pkgs.fcitx5-anthy (let repo = pkgs.fetchgit { url = "https://gitlab.com/msyds/syd-fcitx5-tables"; tag = "v1.0.0"; hash = "sha256-Uw+hDRMV0icsObxMgRbidaMW+NYDBAYLTaPjPB5v+5g="; }; in pkgs.callPackage "${repo}/package.nix" {}) ]; settings = { # Bind QuickPhrase to `s-;`. addons."quickphrase".sections = { TriggerKey."0" = "Super+semicolon"; }; # Enable the Engish, math, and X-SAMPA keyboards. This section is # easiest to edit if you first delete the Home-manager symlink at # ~/.config/fcitx5, configure Fcitx5 graphically via # fcitx5-configtool, then translate the config at # ~/.config/fcitx5/profile. inputMethod = { GroupOrder."0" = "Default"; "Groups/0" = { Name = "Default"; "Default Layout" = "us"; DefaultIM = "sydmath"; }; "Groups/0/Items/0".Name = "keyboard-us"; "Groups/0/Items/1".Name = "sydmath"; "Groups/0/Items/2".Name = "ipa-x-sampa"; "Groups/0/Items/3".Name = "anthy"; }; }; }; }; }; }