Merge pull request #117809 from mayflower/graylog-4
graylog: improve JRE handling
This commit is contained in:
commit
c2836eb953
2 changed files with 4 additions and 6 deletions
|
@ -39,7 +39,6 @@ in
|
|||
type = types.package;
|
||||
default = pkgs.graylog;
|
||||
defaultText = "pkgs.graylog";
|
||||
example = literalExample "pkgs.graylog";
|
||||
description = "Graylog package to use.";
|
||||
};
|
||||
|
||||
|
@ -138,14 +137,13 @@ in
|
|||
"d '${cfg.messageJournalDir}' - ${cfg.user} - - -"
|
||||
];
|
||||
|
||||
systemd.services.graylog = with pkgs; {
|
||||
systemd.services.graylog = {
|
||||
description = "Graylog Server";
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
environment = {
|
||||
JAVA_HOME = jre;
|
||||
GRAYLOG_CONF = "${confFile}";
|
||||
};
|
||||
path = [ pkgs.jre_headless pkgs.which pkgs.procps ];
|
||||
path = [ pkgs.which pkgs.procps ];
|
||||
preStart = ''
|
||||
rm -rf /var/lib/graylog/plugins || true
|
||||
mkdir -p /var/lib/graylog/plugins -m 755
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{ lib, stdenv, fetchurl, makeWrapper, jre_headless, nixosTests }:
|
||||
{ lib, stdenv, fetchurl, makeWrapper, openjdk11_headless, nixosTests }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "graylog";
|
||||
|
@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
|
|||
dontStrip = true;
|
||||
|
||||
nativeBuildInputs = [ makeWrapper ];
|
||||
makeWrapperArgs = [ "--prefix" "PATH" ":" "${jre_headless}/bin" ];
|
||||
makeWrapperArgs = [ "--set-default" "JAVA_HOME" "${openjdk11_headless}" ];
|
||||
|
||||
passthru.tests = { inherit (nixosTests) graylog; };
|
||||
|
||||
|
|
Loading…
Reference in a new issue