1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-11-08 19:46:05 +01:00
home-manager/modules/programs/onlyoffice.nix
Austin Horstman 86402a17b6 treewide: flatten single file modules
Some files don't need nesting and can be root level again to reduce
conflicts with other PRs.

Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
2025-06-23 16:20:26 -05:00

53 lines
1.2 KiB
Nix

{
lib,
pkgs,
config,
...
}:
let
inherit (lib)
mkIf
mkEnableOption
mkPackageOption
mkOption
;
cfg = config.programs.onlyoffice;
formatter = pkgs.formats.keyValue { };
in
{
meta.maintainers = with lib.hm.maintainers; [ aguirre-matteo ];
options.programs.onlyoffice = {
enable = mkEnableOption "onlyoffice";
package = mkPackageOption pkgs "onlyoffice-desktopeditors" { nullable = true; };
settings = mkOption {
type = formatter.type;
default = { };
example = ''
UITheme = "theme-contrast-dark";
editorWindowMode = false;
forcedRtl = false;
maximized = true;
titlebar = "custom";
'';
description = ''
Configuration settings for Onlyoffice.
All configurable options can be deduced by enabling them through the
GUI and observing the changes in ~/.config/onlyoffice/DesktopEditors.conf.
'';
};
};
config = mkIf cfg.enable {
home.packages = lib.mkIf (cfg.package != null) [ cfg.package ];
xdg.configFile."onlyoffice/DesktopEditors.conf" = mkIf (cfg.settings != { }) {
source = formatter.generate "onlyoffice-config" cfg.settings;
};
};
}