From 9cc181f5c624c883518b7a5a681b87eba19b561c Mon Sep 17 00:00:00 2001 From: Your Name Date: Sun, 8 Aug 2021 14:26:11 +0800 Subject: [PATCH] nixos/nexus: add jvm package option --- nixos/modules/services/web-apps/nexus.nix | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/nixos/modules/services/web-apps/nexus.nix b/nixos/modules/services/web-apps/nexus.nix index d4d507362c97..b652a01566d3 100644 --- a/nixos/modules/services/web-apps/nexus.nix +++ b/nixos/modules/services/web-apps/nexus.nix @@ -7,7 +7,6 @@ let cfg = config.services.nexus; in - { options = { services.nexus = { @@ -19,6 +18,16 @@ in description = "Package which runs Nexus3"; }; + jdkPackage = mkOption { + type = types.package; + default = pkgs.openjdk8; + defaultText = literalExample "pkgs.openjdk8"; + example = literalExample "pkgs.openjdk8"; + description = '' + The JDK package to use. + ''; + }; + user = mkOption { type = types.str; default = "nexus"; @@ -88,7 +97,7 @@ in createHome = true; }; - users.groups.${cfg.group} = {}; + users.groups.${cfg.group} = { }; systemd.services.nexus = { description = "Sonatype Nexus3"; @@ -101,6 +110,7 @@ in NEXUS_USER = cfg.user; NEXUS_HOME = cfg.home; + INSTALL4J_JAVA_HOME = "${cfg.jdkPackage}"; VM_OPTS_FILE = pkgs.writeText "nexus.vmoptions" cfg.jvmOpts; };