From 4d23eae938b33fd9cf5ad046d18fb0266b3ca8de Mon Sep 17 00:00:00 2001 From: Felix Singer Date: Wed, 11 May 2022 00:09:09 +0200 Subject: [PATCH] nixos/redmine: Add PDF export support for gant Ghostscript is needed to export Gant diagrams as PDF. Thus, add the option `services.redmine.components.ghostscript` allowing to enable or disable the component. The component is disabled by default. Enabling the option will add Ghostscript to the Redmine environment and configure the setting `gs_command` in the Redmine configuration file. Signed-off-by: Felix Singer --- nixos/modules/services/misc/redmine.nix | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/nixos/modules/services/misc/redmine.nix b/nixos/modules/services/misc/redmine.nix index 0cf8acbbf79e..0dcc50978437 100644 --- a/nixos/modules/services/misc/redmine.nix +++ b/nixos/modules/services/misc/redmine.nix @@ -243,6 +243,12 @@ in default = false; description = "Allows exporting Gant diagrams as PNG."; }; + + ghostscript = mkOption { + type = types.bool; + default = false; + description = "Allows exporting Gant diagrams as PDF."; + }; }; }; }; @@ -272,6 +278,7 @@ in scm_git_command = if cfg.components.git then "${pkgs.git}/bin/git" else ""; scm_cvs_command = if cfg.components.cvs then "${pkgs.cvs}/bin/cvs" else ""; scm_bazaar_command = if cfg.components.breezy then "${pkgs.breezy}/bin/bzr" else ""; + gs_command = if cfg.components.ghostscript then "${pkgs.ghostscript}/bin/gs" else ""; }; }; @@ -339,7 +346,8 @@ in ++ optional cfg.components.git git ++ optional cfg.components.cvs cvs ++ optional cfg.components.breezy breezy - ++ optional cfg.components.imagemagick imagemagick; + ++ optional cfg.components.imagemagick imagemagick + ++ optional cfg.components.ghostscript ghostscript; preStart = '' rm -rf "${cfg.stateDir}/plugins/"*