aboutsummaryrefslogtreecommitdiff
path: root/nixpkgs/nixos/modules/services/web-apps/gerrit.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/nixos/modules/services/web-apps/gerrit.nix')
-rw-r--r--nixpkgs/nixos/modules/services/web-apps/gerrit.nix21
1 files changed, 21 insertions, 0 deletions
diff --git a/nixpkgs/nixos/modules/services/web-apps/gerrit.nix b/nixpkgs/nixos/modules/services/web-apps/gerrit.nix
index b184c0754d4..657b1a4fc5b 100644
--- a/nixpkgs/nixos/modules/services/web-apps/gerrit.nix
+++ b/nixpkgs/nixos/modules/services/web-apps/gerrit.nix
@@ -17,6 +17,10 @@ let
lib.generators.toGitINI cfg.settings
);
+ replicationConfig = pkgs.writeText "replication.conf" (
+ lib.generators.toGitINI cfg.replicationSettings
+ );
+
# Wrap the gerrit java with all the java options so it can be called
# like a normal CLI app
gerrit-cli = pkgs.writeShellScriptBin "gerrit" ''
@@ -106,6 +110,15 @@ in
'';
};
+ replicationSettings = mkOption {
+ type = gitIniType;
+ default = {};
+ description = ''
+ Replication configuration. This will be generated to the
+ <literal>etc/replication.config</literal> file.
+ '';
+ };
+
plugins = mkOption {
type = types.listOf types.package;
default = [];
@@ -138,6 +151,13 @@ in
config = mkIf cfg.enable {
+ assertions = [
+ {
+ assertion = cfg.replicationSettings != {} -> elem "replication" cfg.builtinPlugins;
+ message = "Gerrit replicationSettings require enabling the replication plugin";
+ }
+ ];
+
services.gerrit.settings = {
cache.directory = "/var/cache/gerrit";
container.heapLimit = cfg.jvmHeapLimit;
@@ -194,6 +214,7 @@ in
# copy the config, keep it mutable because Gerrit
ln -sfv ${gerritConfig} etc/gerrit.config
+ ln -sfv ${replicationConfig} etc/replication.config
# install the plugins
rm -rf plugins