nix-config/modules/desktop/office/libreoffice.nix
Jordan Holt b8279e44e6
Some checks failed
Check flake / build-amd64-linux (push) Failing after 2m47s
Compile LibreOffice with GTK4 support
2024-06-23 01:14:21 +01:00

39 lines
946 B
Nix

{ config, lib, pkgs, ... }:
let
cfg = config.modules.desktop.office.libreoffice;
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;
};
});
};
in {
options.modules.desktop.office.libreoffice = {
enable = lib.mkOption {
default = false;
example = true;
};
};
config = lib.mkIf cfg.enable {
user.packages = with pkgs; [
(if config.modules.desktop.kde.enable == true then libreoffice-qt else libreoffice-gtk4)
hunspell
hunspellDicts.en-gb-large
hunspellDicts.en-us-large
];
};
}