My personal project and infrastructure archive
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
nomicon/pkgs/tools/inputmethods/ibus-engines/ibus-typing-booster/wrapper.nix

30 lines
849 B

{ typing-booster, symlinkJoin, hunspellDicts, lib, makeWrapper
, langs ? [ "de-de" "en-us" "es-es" "fr-moderne" "it-it" "sv-se" "sv-fi" ]
}:
let
hunspellDirs = with lib; makeSearchPath ":" (flatten (forEach langs (lang: [
"${hunspellDicts.${lang}}/share/hunspell"
"${hunspellDicts.${lang}}/share/myspell"
"${hunspellDicts.${lang}}/share/myspell/dicts"
])));
in
symlinkJoin {
name = "${typing-booster.name}-with-hunspell";
paths = [ typing-booster ];
nativeBuildInputs = [ makeWrapper ];
postBuild = ''
for i in bin/emoji-picker libexec/ibus-{setup,engine}-typing-booster; do
wrapProgram "$out/$i" \
--prefix NIX_HUNSPELL_DIRS : ${lib.escapeShellArg hunspellDirs}
done
sed -i -e "s,${typing-booster},$out," $out/share/ibus/component/typing-booster.xml
'';
inherit (typing-booster) meta;
}