Not quite sure how to get “Hyphen” working with “LibreOffice”
fonts.fonts = [pkgs.google-fonts];
environment.systemPackages = with pkgs; [
# vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
# wget
# basic computer software
libreoffice
google-fonts
hyphen
hunspell
hunspellDicts.en_US
hunspellDicts.en-us
hunspellDicts.en_US-large
hunspellDicts.en-us-large
hunspellDicts.en-gb-large
hunspellDicts.en_GB-large
1 Like
I have the same issue. Libreoffice never complained about hyphenation until today.
I now also have
libreoffice
hyphen
hunspell
hunspellDicts.en_US
installed and libreoffice still complains. Previously, i didn’t have hyphen installed and libreoffice didn’t complain.
From the LibreOffice entry on ArchWiki, it seems like both the hyphen package and the hyphen-en language hyphen rule set have to be installed. Nixpkgs does not have the hyphen-en rule set packaged. While the way LibreOffice performs lookups for these rule sets is unclear, I’ll try to package them and see how it goes.
feliks
October 4, 2024, 12:11pm
4
@kotatsuyaki Thanks for looking into it. Did you make any progress on this?
The solution is to use hyphenDicts:
[
libreoffice
hyphenDicts.de_DE
]
There are currently only English and Germany languages, but you can copy mkDictFromLibreofficeGit from
mkDictFromLibreofficeGit =
{
subdir,
shortName,
shortDescription,
dictFileName,
readmeFileName,
}:
stdenv.mkDerivation rec {
version = "24.8";
pname = "hyphen-dict-${shortName}-libreoffice";
src = fetchgit {
url = "https://anongit.freedesktop.org/git/libreoffice/dictionaries.git";
rev = "a2bf59878dd76685803ec260e15d875746ad6e25";
hash = "sha256-3CvjgNjsrm4obATK6LmtYob8i2ngTbwP6FB4HlJMPCE=";
};
meta = with lib; {
description = "Hyphen dictionary for ${shortDescription} from LibreOffice";
homepage = "https://wiki.documentfoundation.org/Development/Dictionaries";
license = with licenses; [ mpl20 ];
This file has been truncated. show original
And use like
Also see
NixOS:master ← Andrew15-5:add-ru-hyphen
opened 10:50AM - 01 Apr 25 UTC
For some reason README file for Russian has different naming upstream, therefore… `readmeFileName` for all languages was changed to accommodate both naming schemes. I'm not sure if there is a cleaner way to handle this, other than report it upstream and wait for patch to be merged. Also, is this an update to `hyphen` package or to `hyphenDicts`...dictionary of packages?
I've tested this with
```nix
{
nixpkgs.overlays = let
pkgs = import inputs.ru-hyphen {inherit system;};
in [(_: _: {inherit (pkgs) hyphenDicts;})];
}
```
Cc @theCapypara
## Things done
- Built on platform(s)
- [ ] x86_64-linux
- [ ] aarch64-linux
- [ ] x86_64-darwin
- [ ] aarch64-darwin
- For non-Linux: Is sandboxing enabled in `nix.conf`? (See [Nix manual](https://nixos.org/manual/nix/stable/command-ref/conf-file.html))
- [ ] `sandbox = relaxed`
- [ ] `sandbox = true`
- [ ] Tested, as applicable:
- [NixOS test(s)](https://nixos.org/manual/nixos/unstable/index.html#sec-nixos-tests) (look inside [nixos/tests](https://github.com/NixOS/nixpkgs/blob/master/nixos/tests))
- and/or [package tests](https://github.com/NixOS/nixpkgs/blob/master/pkgs/README.md#package-tests)
- or, for functions and "core" functionality, tests in [lib/tests](https://github.com/NixOS/nixpkgs/blob/master/lib/tests) or [pkgs/test](https://github.com/NixOS/nixpkgs/blob/master/pkgs/test)
- made sure NixOS tests are [linked](https://github.com/NixOS/nixpkgs/blob/master/pkgs/README.md#linking-nixos-module-tests-to-a-package) to the relevant packages
- [ ] Tested compilation of all packages that depend on this change using `nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"`. Note: all changes have to be committed, also see [nixpkgs-review usage](https://github.com/Mic92/nixpkgs-review#usage)
- [ ] Tested basic functionality of all binary files (usually in `./result/bin/`)
- [25.05 Release Notes](https://github.com/NixOS/nixpkgs/blob/master/nixos/doc/manual/release-notes/rl-2505.section.md) (or backporting [24.11](https://github.com/NixOS/nixpkgs/blob/master/nixos/doc/manual/release-notes/rl-2411.section.md) and [25.05](https://github.com/NixOS/nixpkgs/blob/master/nixos/doc/manual/release-notes/rl-2505.section.md) Release notes)
- [ ] (Package updates) Added a release notes entry if the change is major or breaking
- [ ] (Module updates) Added a release notes entry if the change is significant
- [ ] (Module addition) Added a release notes entry if adding a new NixOS module
- [x] Fits [CONTRIBUTING.md](https://github.com/NixOS/nixpkgs/blob/master/CONTRIBUTING.md).
---
Add a :+1: [reaction] to [pull requests you find important].
[reaction]: https://github.blog/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/
[pull requests you find important]: https://github.com/NixOS/nixpkgs/pulls?q=is%3Aopen+sort%3Areactions-%2B1-desc
1 Like