0
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-07-14 14:10:33 +03:00

nixos/redmine: Make optional components configurable

Currently, optional components and integrations of Redmine are enforced
to install in NixOS. Thus, add the following options allowing the users
to enable or disable the components. They are disabled by default.
Enabling these options will add their package to the Redmine environment
and will configure their specific setting in the Redmine configuration
file.

  * services.redmine.components.subversion
  * services.redmine.components.mercurial
  * services.redmine.components.git
  * services.redmine.components.cvs
  * services.redmine.components.breezy
  * services.redmine.components.imagemagick

Signed-off-by: Felix Singer <felixsinger@posteo.net>
This commit is contained in:
Felix Singer 2022-05-07 07:48:08 +02:00
parent 3be58b2afc
commit 92b1cf8b4c

View file

@ -206,6 +206,44 @@ in
description = "Create the database and database user locally."; description = "Create the database and database user locally.";
}; };
}; };
components = {
subversion = mkOption {
type = types.bool;
default = false;
description = "Subversion integration.";
};
mercurial = mkOption {
type = types.bool;
default = false;
description = "Mercurial integration.";
};
git = mkOption {
type = types.bool;
default = false;
description = "git integration.";
};
cvs = mkOption {
type = types.bool;
default = false;
description = "cvs integration.";
};
breezy = mkOption {
type = types.bool;
default = false;
description = "bazaar integration.";
};
imagemagick = mkOption {
type = types.bool;
default = false;
description = "Allows exporting Gant diagrams as PNG.";
};
};
}; };
}; };
@ -229,11 +267,11 @@ in
services.redmine.settings = { services.redmine.settings = {
production = { production = {
scm_subversion_command = "${pkgs.subversion}/bin/svn"; scm_subversion_command = if cfg.components.subversion then "${pkgs.subversion}/bin/svn" else "";
scm_mercurial_command = "${pkgs.mercurial}/bin/hg"; scm_mercurial_command = if cfg.components.mercurial then "${pkgs.mercurial}/bin/hg" else "";
scm_git_command = "${pkgs.git}/bin/git"; scm_git_command = if cfg.components.git then "${pkgs.git}/bin/git" else "";
scm_cvs_command = "${pkgs.cvs}/bin/cvs"; scm_cvs_command = if cfg.components.cvs then "${pkgs.cvs}/bin/cvs" else "";
scm_bazaar_command = "${pkgs.breezy}/bin/bzr"; scm_bazaar_command = if cfg.components.breezy then "${pkgs.breezy}/bin/bzr" else "";
}; };
}; };
@ -295,13 +333,14 @@ in
environment.REDMINE_LANG = "en"; environment.REDMINE_LANG = "en";
environment.SCHEMA = "${cfg.stateDir}/cache/schema.db"; environment.SCHEMA = "${cfg.stateDir}/cache/schema.db";
path = with pkgs; [ path = with pkgs; [
imagemagick ]
breezy ++ optional cfg.components.subversion subversion
cvs ++ optional cfg.components.mercurial mercurial
git ++ optional cfg.components.git git
mercurial ++ optional cfg.components.cvs cvs
subversion ++ optional cfg.components.breezy breezy
]; ++ optional cfg.components.imagemagick imagemagick;
preStart = '' preStart = ''
rm -rf "${cfg.stateDir}/plugins/"* rm -rf "${cfg.stateDir}/plugins/"*
rm -rf "${cfg.stateDir}/public/themes/"* rm -rf "${cfg.stateDir}/public/themes/"*