emmanuelrosa / erosanix

My main NixOS/Nix Flakes repository
MIT License
78 stars 4 forks source link

onlyoffice module seems to be broken #6

Closed nikp123 closed 1 year ago

nikp123 commented 1 year ago

image image

nikp123 commented 1 year ago

also i think i can patch onlyoffice instead https://github.com/ONLYOFFICE/core/blob/02c78a1e6fb91260b371ccaa051e5d66a5d637c8/DesktopEditor/fontengine/ApplicationFonts.cpp#L1780

nikp123 commented 1 year ago

yep https://search.nixos.org/options?channel=22.11&show=fonts.fontDir.enable&from=0&size=50&sort=relevance&type=packages&query=font though, this is a massive hack

nikp123 commented 1 year ago

didnt work because onlyoffice was built from binary, but they've thankfully added a CUSTOM_PATH to play around with https://github.com/ONLYOFFICE/core/pull/815/commits/68582b65d1ce158b22d0665f096480982df816d6

nikp123 commented 1 year ago

bummer, it doesn't work with symlinks. though, you could use something like this in order to get fonts to work

nikp123 commented 1 year ago

worked a bad solution, but it's a solution:

  nixpkgs.overlays = [
    ( self: super: {
      onlyoffice-bin = super.onlyoffice-bin.overrideAttrs (old: {
        preFixup = (old.preFixup or "") + ''
          gappsWrapperArgs+=(
            --set CUSTOM_FONTS_PATH "${pkgs.microsoft-fonts}/share/fonts/TTF"  # or whatever font you desire to use
          )
        '';
      });
    })
  ];
emmanuelrosa commented 1 year ago

Yes, ONLYOFFICE has a known issue (which I've reported) when /usr/share/fonts contains symlinks. The ONLYOFFICE module uses the code from fonts.fontDir.enable but I copy the fonts instead of creating symlinks to them.

I'm unable to reproduce your error. Can you show me the build log?

nikp123 commented 1 year ago

Yes, ONLYOFFICE has a known issue (which I've reported) when /usr/share/fonts contains symlinks. The ONLYOFFICE module uses the code from fonts.fontDir.enable but I copy the fonts instead of creating symlinks to them.

I'm unable to reproduce your error. Can you show me the build log?

The log is quite boring, as it's just a simple "folder not found" error. log.txt

nikp123 commented 1 year ago

I imported your module as a flake, added this to my nixOS modules: erosanix.nixosModules.onlyoffice

And invoked programs.onlyoffice.enable = true;

emmanuelrosa commented 1 year ago

I pushed an update that I think will fix it.

The error message is correct in that the given path is not a directory; It's a symlink. The update copies the icons instead of using a symlink. There must be a difference between how that's handled on NixOS 22.11 and NixOS master.

nikp123 commented 1 year ago

image

Uh, yeah, more bugs to crush unfortunately.

emmanuelrosa commented 1 year ago

OK, I see that the package on NixOS 21.11 doesn't have icons. I pushed an update that should work around that.

nikp123 commented 1 year ago

Works perfectly now, thank you.