This commit is contained in:
2026-08-02 21:35:35 +09:00
parent dfc4dc79d6
commit 5e12c1d953
3 changed files with 74 additions and 170 deletions
+74 -57
View File
@@ -1,43 +1,4 @@
{ pkgs, ... }:
let
# CC-BY-SA 3.0: https://github.com/jiro-aqua/aquamozc-dictionary
kanaengDictionary =
pkgs.runCommandNoCC "mozcdic-ut-kanaeng"
{
nativeBuildInputs = with pkgs; [
gawk
gnutar
bzip2
];
}
''
mkdir -p "$out"
awk -F '\t' 'NF == 3 { print $1 "\t0000\t0000\t8000\t" $2; }' \
${
pkgs.fetchurl {
url = "https://raw.githubusercontent.com/jiro-aqua/aquamozc-dictionary/ae7fae40b18f1500d97e3e4531fdff22abdc6a39/edict-katakana-english/kanaeng.mozc.txt";
hash = "sha256-rw8AlE2YAc3d4B6qQ6+LYchDiGwm6TesIfOozzZBGXo=";
}
} > mozcdic-ut-kanaeng.txt
tar -cjf "$out/mozcdic-ut-kanaeng.txt.tar.bz2" mozcdic-ut-kanaeng.txt
'';
mozcWithKanaeng = pkgs.mozc.override {
dictionaries = with pkgs; [
mozcdic-ut-alt-cannadic
mozcdic-ut-edict2
mozcdic-ut-jawiki
mozcdic-ut-neologd
mozcdic-ut-personal-names
mozcdic-ut-place-names
mozcdic-ut-skk-jisyo
mozcdic-ut-sudachidict
kanaengDictionary
];
};
in
{
services.hazkey.enable = true;
@@ -48,30 +9,86 @@ in
fcitx5 = {
waylandFrontend = true;
addons = with pkgs; [
(fcitx5-mozc.override { mozc = mozcWithKanaeng; })
fcitx5-gtk
kdePackages.fcitx5-qt
qt6Packages.fcitx5-configtool
];
settings.inputMethod = {
GroupOrder."0" = "Default";
"Groups/0" = {
Name = "Default";
"Default Layout" = "jp";
DefaultIM = "mozc";
settings = {
inputMethod = {
GroupOrder."0" = "Default";
"Groups/0" = {
Name = "Default";
"Default Layout" = "jp";
DefaultIM = "hazkey";
};
"Groups/0/Items/0" = {
Name = "keyboard-jp";
};
"Groups/0/Items/1" = {
Name = "hazkey";
};
};
"Groups/0/Items/0" = {
Name = "keyboard-jp";
Layout = "";
};
"Groups/0/Items/1" = {
Name = "mozc";
Layout = "";
};
"Groups/0/Items/2" = {
Name = "hazkey";
Layout = "";
globalOptions = {
Hotkey = {
EnumerateWithTriggerKeys = false;
AltTriggerKeys = "";
EnumerateSkipFirst = false;
ModifierOnlyKeyTimeout = 250;
};
"Hotkey/TriggerKeys" = {
"1" = "Zenkaku_Hankaku";
};
"Hotkey/ActivateKeys" = {
"0" = "Henkan";
};
"Hotkey/DeactivateKeys" = {
"0" = "Muhenkan";
};
"Hotkey/PrevPage" = {
"0" = "Up";
};
"Hotkey/NextPage" = {
"0" = "Down";
};
"Hotkey/PrevCandidate" = {
"0" = "Shift+Tab";
};
"Hotkey/NextCandidate" = {
"0" = "Tab";
};
"Hotkey/TogglePreedit" = {
"0" = "Control+Alt+P";
};
Behavior = {
ActiveByDefault = false;
resetStateWhenFocusIn = "No";
ShareInputState = "No";
PreeditEnabledByDefault = true;
ShowInputMethodInformation = true;
showInputMethodInformationWhenFocusIn = false;
CompactInputMethodInformation = true;
ShowFirstInputMethodInformation = true;
DefaultPageSize = 5;
OverrideXkbOption = false;
CustomXkbOption = "";
EnabledAddons = "";
DisabledAddons = "";
PreloadInputMethod = true;
AllowInputMethodForPassword = false;
ShowPreeditForPassword = false;
AutoSavePeriod = 30;
};
};
};
};