mirror of
https://github.com/aviallon/nixos-lib.git
synced 2026-04-06 01:38:06 +00:00
[Programs/LibreOffice] Init LibreOffice package configuration
This commit is contained in:
parent
78049d829a
commit
27b7e334b3
4 changed files with 72 additions and 2 deletions
|
|
@ -138,6 +138,8 @@ in {
|
||||||
"veracrypt"
|
"veracrypt"
|
||||||
];
|
];
|
||||||
|
|
||||||
|
aviallon.programs.libreoffice.enable = mkIf (!generalCfg.minimal) true;
|
||||||
|
|
||||||
services.packagekit.enable = mkDefault (!generalCfg.minimal);
|
services.packagekit.enable = mkDefault (!generalCfg.minimal);
|
||||||
security.sudo.extraConfig =
|
security.sudo.extraConfig =
|
||||||
''
|
''
|
||||||
|
|
|
||||||
|
|
@ -96,13 +96,12 @@ in {
|
||||||
krdc
|
krdc
|
||||||
sddm-kcm
|
sddm-kcm
|
||||||
|
|
||||||
libreoffice-qt
|
|
||||||
|
|
||||||
myFirefox
|
myFirefox
|
||||||
];
|
];
|
||||||
|
|
||||||
aviallon.desktop.browser.firefox.overrides.enablePlasmaBrowserIntegration = true;
|
aviallon.desktop.browser.firefox.overrides.enablePlasmaBrowserIntegration = true;
|
||||||
|
|
||||||
|
aviallon.programs.libreoffice.qt = true;
|
||||||
|
|
||||||
xdg.portal.enable = mkDefault true;
|
xdg.portal.enable = mkDefault true;
|
||||||
xdg.icons.enable = true;
|
xdg.icons.enable = true;
|
||||||
|
|
|
||||||
|
|
@ -6,5 +6,6 @@
|
||||||
./git.nix
|
./git.nix
|
||||||
./nano.nix
|
./nano.nix
|
||||||
./nvtop.nix
|
./nvtop.nix
|
||||||
|
./libreoffice.nix
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
68
programs/libreoffice.nix
Normal file
68
programs/libreoffice.nix
Normal file
|
|
@ -0,0 +1,68 @@
|
||||||
|
{ config, pkgs, lib, myLib, ... }:
|
||||||
|
with lib;
|
||||||
|
let
|
||||||
|
cfg = config.aviallon.programs.libreoffice;
|
||||||
|
toStringOrFunc = x:
|
||||||
|
if isFunction x
|
||||||
|
then "<function>"
|
||||||
|
else (builtins.toJSON x)
|
||||||
|
;
|
||||||
|
applyOverrides = overrides: pkg:
|
||||||
|
foldl'
|
||||||
|
(prev: override:
|
||||||
|
let
|
||||||
|
r = (trace "override: ${toStringOrFunc override}" override) (trace "prev: ${toString prev}" prev);
|
||||||
|
in trace "result: ${toString r}" r
|
||||||
|
)
|
||||||
|
pkg
|
||||||
|
overrides
|
||||||
|
;
|
||||||
|
in {
|
||||||
|
options.aviallon.programs.libreoffice = {
|
||||||
|
enable = mkEnableOption "LibreOffice";
|
||||||
|
variant = mkOption {
|
||||||
|
type = with types; types.enum [ "still" "fresh" ];
|
||||||
|
default = "fresh";
|
||||||
|
description = "Which LibreOffice variant to use";
|
||||||
|
};
|
||||||
|
qt = mkEnableOption "Qt support";
|
||||||
|
gnome = mkOption {
|
||||||
|
description = "Wether to enable Gnome support";
|
||||||
|
default = true;
|
||||||
|
type = types.bool;
|
||||||
|
internal = true;
|
||||||
|
};
|
||||||
|
opencl = mkEnableOption "OpenCL support";
|
||||||
|
package = mkOption {
|
||||||
|
description = "Which final LibreOffice package to use";
|
||||||
|
type = myLib.types.package';
|
||||||
|
};
|
||||||
|
package' = mkOption {
|
||||||
|
internal = true;
|
||||||
|
description = "Which base (unwrapped) LibreOffice package to use";
|
||||||
|
default = if cfg.qt then pkgs.libreoffice-qt.libreoffice else pkgs.libreoffice-unwrapped;
|
||||||
|
type = myLib.types.package';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
aviallon.programs.libreoffice.package =
|
||||||
|
let
|
||||||
|
overridesList = []
|
||||||
|
++ [(pkg: pkg.override {
|
||||||
|
variant = cfg.variant;
|
||||||
|
})]
|
||||||
|
++ optional cfg.opencl (pkg: pkg.overrideAttrs (old: {
|
||||||
|
buildInputs = old.buildInputs ++ [ pkgs.ocl-icd ];
|
||||||
|
}))
|
||||||
|
;
|
||||||
|
in pkgs.libreoffice.override {
|
||||||
|
libreoffice = applyOverrides overridesList cfg.package';
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
environment.systemPackages = [
|
||||||
|
cfg.package
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue