ONLYOFFICE: Difference between revisions
m The previous fix was ineffective, update it to a proper fix |
Restored back the MS Corefont installation part that I accidentally nuked |
||
| Line 7: | Line 7: | ||
{{file|/etc/nixos/configuration.nix|nix|3=<nowiki> | {{file|/etc/nixos/configuration.nix|nix|3=<nowiki> | ||
environment.systemPackages = [ pkgs.onlyoffice-desktopeditors ]; | environment.systemPackages = [ pkgs.onlyoffice-desktopeditors ]; | ||
</nowiki>}} | |||
=== Install missing corefonts === | |||
By default, NixOS doesn't ship with any of the Microsoft fonts OOTB, to get the Microsoft corefonts, add the following to your NixOS config: | |||
{{file|/etc/nixos/configuration.nix|nix|<nowiki> | |||
# Allow installation of unfree corefonts package | |||
nixpkgs.config.allowUnfreePredicate = pkg: | |||
builtins.elem (lib.getName pkg) [ "corefonts" ]; | |||
fonts.fonts = with pkgs; [ | |||
corefonts | |||
]; | |||
</nowiki>}} | </nowiki>}} | ||
== Troubleshooting == | == Troubleshooting == | ||
=== | === OnlyOffice can't see or use any system fonts === | ||
According to one [https://github.com/ONLYOFFICE/DocumentServer/issues/1859 upstream bug] ONLYOFFICE DesktopEditors is unable to locate [[Fonts|font]] files on NixOS. | According to one [https://github.com/ONLYOFFICE/DocumentServer/issues/1859 upstream bug] ONLYOFFICE DesktopEditors is unable to locate [[Fonts|font]] files on NixOS. | ||
Latest revision as of 22:38, 9 October 2026
ONLYOFFICE is a software suite that offers online and offline tools for document editing, collaboration, and management. It is developed by Ascensio System SIA, a company based in Riga, Latvia. ONLYOFFICE consists of several components, such as Docs, Workspace, Desktop Editors, and Mobile Apps. It is an open-source project that aims to provide a secure and compatible alternative to other office suites.
Installation
Add following line to your configuration to enable ONLYOFFICE
environment.systemPackages = [ pkgs.onlyoffice-desktopeditors ];
Install missing corefonts
By default, NixOS doesn't ship with any of the Microsoft fonts OOTB, to get the Microsoft corefonts, add the following to your NixOS config:
# Allow installation of unfree corefonts package
nixpkgs.config.allowUnfreePredicate = pkg:
builtins.elem (lib.getName pkg) [ "corefonts" ];
fonts.fonts = with pkgs; [
corefonts
];
Troubleshooting
OnlyOffice can't see or use any system fonts
According to one upstream bug ONLYOFFICE DesktopEditors is unable to locate font files on NixOS.
Currently, the best workaround to first apply the fix mentioned in Fixes for non-Nix applications#Flatpak, Distrobox, Appimage and other non-Nix applications can't find system fonts/icons/themes, then, as ONLYOFFICE DeskopEditors is currently packaged with FHSEnv and bwrap as of NixOS 26.05, pass the /usr/share/fonts directory inside the bubblewrap/FHSEnv sandbox:
# onlyoffice-font-fix.nix
{ config, pkgs, ... }:
{
# Expose installed fonts under /run/current-system/sw/share/X11/fonts
fonts.fontDir.enable = true;
# OnlyOffice font fix
nixpkgs.overlays = [
(final: prev: {
onlyoffice-desktopeditors = prev.buildFHSEnv (
prev.onlyoffice-desktopeditors.passthru.args
// {
extraBwrapArgs = (prev.onlyoffice-desktopeditors.passthru.args.extraBwrapArgs or [ ]) ++ [
# Bind mount host system fonts into the FHS container's /usr/share/fonts:
"--ro-bind"
"/usr/share/fonts"
"/usr/share/fonts"
];
}
);
})
];
}
Another workaround is to install missing or additional fonts and copy them to the user directory
# Allow installation of unfree corefonts package
nixpkgs.config.allowUnfreePredicate = pkg:
builtins.elem (lib.getName pkg) [ "corefonts" ];
fonts.fonts = with pkgs; [
corefonts
];
$ mkdir -p ~/.local/share/fonts
$ # Query store path to the corefonts package
$ NIXPKGS_ALLOW_UNFREE=1 nix-store --query --outputs $(nix-instantiate '<nixpkgs>' -A corefonts)
$ # Change the store path according to result of the command above
$ cp /nix/store/ssw7d3cl2dzps6y1c88c01xclsigmjqf-corefonts-1/share/fonts/truetype/* ~/.local/share/fonts/
$ chmod 644 ~/.local/share/fonts/*
See also
- LibreOffice, personal productivity suite that gives you six feature-rich applications for all your document production and data processing needs: Writer, Calc, Impress, Draw, Math and Base.
- ONLYOFFICE DocumentServer