{ config, lib, pkgs, ... }: let cfg = config.modules.programs.libreoffice; in # libreoffice-gtk4 = pkgs.libreoffice.override { # extraMakeWrapperArgs = [ # "--set SAL_USE_VCLPLUGIN gtk4" # ]; # unwrapped = pkgs.libreoffice-unwrapped.overrideAttrs (oldAttrs: { # buildInputs = oldAttrs.buildInputs ++ [ # pkgs.gtk4 # ]; # configureFlags = oldAttrs.configureFlags ++ [ # "--disable-werror" # "--enable-gtk4" # ]; # passthru = oldAttrs.passthru // { # inherit (pkgs) gtk4; # }; # }); # }; { options.modules.programs.libreoffice = { enable = lib.mkOption { default = false; example = true; }; }; config = lib.mkIf cfg.enable { user.packages = with pkgs; [ (if config.modules.system.desktop.kde.enable == true then libreoffice-qt else libreoffice) hunspell hunspellDicts.en-gb-large hunspellDicts.en-us-large ]; }; }