5 # Alphabetic ordering below
20 , gsettings-desktop-schemas
42 # OnlyOffice does not distribute unfree fonts, but makes it easy to pick up
43 # any fonts you install. See:
45 # * https://helpcenter.onlyoffice.com/en/installation/docs-community-install-fonts-linux.aspx
46 # * https://www.onlyoffice.com/blog/2020/04/how-to-add-new-fonts-to-onlyoffice-desktop-editors/
48 # As recommended there, you should download
50 # arial.ttf, calibri.ttf, cour.ttf, symbol.ttf, times.ttf, wingding.ttf
52 # into `~/.local/share/fonts/`, otherwise the default template fonts, and
53 # things like bullet points, will not look as expected.
55 # TODO: Find out which of these fonts we'd be allowed to distribute along
56 # with this package, or how to make this easier for users otherwise.
58 runtimeLibs = lib.makeLibraryPath [
66 derivation = stdenv.mkDerivation rec {
67 pname = "onlyoffice-desktopeditors";
71 url = "https://github.com/ONLYOFFICE/DesktopEditors/releases/download/v${version}/onlyoffice-desktopeditors_amd64.deb";
72 sha256 = "sha256-Hf5CNbUUMuHZHDY3fgD4qpF4UASevscK8DTZlauyHhY=";
92 gsettings-desktop-schemas
93 gst_all_1.gst-plugins-base
120 dontWrapQtApps = true;
123 dpkg-deb --fsys-tarfile $src | tar -x --no-same-permissions --no-same-owner
129 mkdir -p $out/{bin,lib,share}
131 mv usr/bin/* $out/bin
132 mv usr/share/* $out/share/
133 mv opt/onlyoffice/desktopeditors $out/share
135 for f in $out/share/desktopeditors/asc-de-*.png; do
136 size=$(basename "$f" ".png" | cut -d"-" -f3)
137 res="''${size}x''${size}"
138 mkdir -pv "$out/share/icons/hicolor/$res/apps"
139 ln -s "$f" "$out/share/icons/hicolor/$res/apps/onlyoffice-desktopeditors.png"
142 substituteInPlace $out/bin/onlyoffice-desktopeditors \
143 --replace "/opt/onlyoffice/" "$out/share/"
145 ln -s $out/share/desktopeditors/DesktopEditors $out/bin/DesktopEditors
152 --prefix LD_LIBRARY_PATH : "${runtimeLibs}" \
153 --set QT_XKB_CONFIG_ROOT "${xkeyboard_config}/share/X11/xkb" \
154 --set QTCOMPOSE "${xorg.libX11.out}/share/X11/locale" \
155 --set QT_QPA_PLATFORM "xcb"
156 # the bundled version of qt does not support wayland
160 passthru.updateScript = ./update.sh;
165 # In order to download plugins, OnlyOffice uses /usr/bin/curl so we have to wrap it.
166 # Curl still needs to be in runtimeLibs because the library is used directly in other parts of the code.
167 # Fonts are also discovered by looking in /usr/share/fonts, so adding fonts to targetPkgs will include them
169 name = derivation.name;
171 targetPkgs = pkgs': [
177 runScript = "/bin/onlyoffice-desktopeditors";
179 extraInstallCommands = ''
180 mv $out/bin/$name $out/bin/onlyoffice-desktopeditors
182 ln -s ${derivation}/share/icons $out/share
183 cp -r ${derivation}/share/applications $out/share
184 substituteInPlace $out/share/applications/onlyoffice-desktopeditors.desktop \
185 --replace "/usr/bin/onlyoffice-desktopeditors" "$out/bin/onlyoffice-desktopeditors"
189 description = "Office suite that combines text, spreadsheet and presentation editors allowing to create, view and edit local documents";
191 This version is broken on wlroots environments (e.g. Hyprland, Sway).
192 If you are using one of these environments, please use `onlyoffice-bin` instead.
194 homepage = "https://www.onlyoffice.com/";
195 downloadPage = "https://github.com/ONLYOFFICE/DesktopEditors/releases";
196 changelog = "https://github.com/ONLYOFFICE/DesktopEditors/blob/master/CHANGELOG.md";
197 platforms = [ "x86_64-linux" ];
198 sourceProvenance = with sourceTypes; [ binaryNativeCode ];
199 license = licenses.agpl3Plus;
200 maintainers = with maintainers; [ nh2 gtrunsec ];