git.iko.soy/typeable/nixpkgs
on master help sign in
signal-desktop: Allow overriding the spell checker language (#44456)

Thought this could be useful for others as well. Unfortunately it will also override the UI language. Example usage: environment.systemPackages = with pkgs; [ (signal-desktop.override { spellcheckerLanguage = "de_DE"; }) ];

commit9ef1406a9918f3414d081563ba34084c5e187a58 authorMichael Weiss <dev.primeos@gmail.com> dateSat 4 Aug 2018, 16:01 (8 years ago) parentd4893a7
1 file changed+16
pkgs/applications/networking/instant-messengers/signal-desktop/default.nix+16
pkgs/applications/networking/instant-messengers/signal-desktop/default.nix+16
@@ -3,9 +3,24 @@
33, dbus, libX11, xorg, libXi, libXcursor, libXdamage, libXrandr, libXcomposite
44, libXext, libXfixes, libXrender, libXtst, libXScrnSaver, nss, nspr, alsaLib
55, cups, expat, udev
6+# Unfortunately this also overwrites the UI language (not just the spell
7+# checking language!):
8+, hunspellDicts, spellcheckerLanguage ? null # E.g. "de_DE"
9+# For a full list of available languages:
10+# $ cat pkgs/development/libraries/hunspell/dictionaries.nix | grep "dictFileName =" | awk '{ print $3 }'
611}:
712
813let
14+ customLanguageWrapperArgs = (with lib;
15+ let
16+ # E.g. "de_DE" -> "de-de" (spellcheckerLanguage -> hunspellDict)
17+ spellLangComponents = splitString "_" spellcheckerLanguage;
18+ hunspellDict = elemAt spellLangComponents 0 + "-" + toLower (elemAt spellLangComponents 1);
19+ in if spellcheckerLanguage != null
20+ then ''
21+ --set HUNSPELL_DICTIONARIES "${hunspellDicts.${hunspellDict}}/share/hunspell" \
22+ --set LC_MESSAGES "${spellcheckerLanguage}"''
23+ else "");
924 rpath = lib.makeLibraryPath [
1025 alsaLib
1126 atk
@@ -68,6 +83,7 @@ in stdenv.mkDerivation rec {
6883 --set-rpath ${rpath}:$out/libexec $out/libexec/signal-desktop
6984 wrapProgram $out/libexec/signal-desktop \
7085 --prefix XDG_DATA_DIRS : "${gtk3}/share/gsettings-schemas/${gtk3.name}/" \
86+ ${customLanguageWrapperArgs} \
7187 "''${gappsWrapperArgs[@]}"
7288
7389 # Symlink to bin