diff --git a/nixos/modules/services/logging/logstash.nix b/nixos/modules/services/logging/logstash.nix index a4fc315d080d7..7a2f5681612cd 100644 --- a/nixos/modules/services/logging/logstash.nix +++ b/nixos/modules/services/logging/logstash.nix @@ -159,10 +159,9 @@ in ###### implementation config = mkIf cfg.enable { - systemd.services.logstash = with pkgs; { + systemd.services.logstash = { description = "Logstash Daemon"; wantedBy = [ "multi-user.target" ]; - environment = { JAVA_HOME = jre; }; path = [ pkgs.bash ]; serviceConfig = { ExecStartPre = ''${pkgs.coreutils}/bin/mkdir -p "${cfg.dataDir}" ; ${pkgs.coreutils}/bin/chmod 700 "${cfg.dataDir}"''; diff --git a/nixos/tests/elk.nix b/nixos/tests/elk.nix index 8488c97c01e8c..fee350de65b5c 100644 --- a/nixos/tests/elk.nix +++ b/nixos/tests/elk.nix @@ -120,6 +120,7 @@ let }; }; + passthru.elkPackages = elk; testScript = '' import json diff --git a/pkgs/tools/misc/logstash/6.x.nix b/pkgs/tools/misc/logstash/6.x.nix index 97ee5b2ed3f39..1c7ab29cbc863 100644 --- a/pkgs/tools/misc/logstash/6.x.nix +++ b/pkgs/tools/misc/logstash/6.x.nix @@ -3,12 +3,13 @@ , lib, stdenv , fetchurl , makeWrapper +, nixosTests , jre }: with lib; -stdenv.mkDerivation rec { +let this = stdenv.mkDerivation rec { version = elk6Version; name = "logstash-${optionalString (!enableUnfree) "oss-"}${version}"; @@ -52,4 +53,12 @@ stdenv.mkDerivation rec { platforms = platforms.unix; maintainers = with maintainers; [ wjlroe offline basvandijk ]; }; -} + passthru.tests = + optionalAttrs (!enableUnfree) ( + assert this.drvPath == nixosTests.elk.ELK-6.elkPackages.logstash.drvPath; + { + elk = nixosTests.elk.ELK-6; + } + ); +}; +in this diff --git a/pkgs/tools/misc/logstash/7.x.nix b/pkgs/tools/misc/logstash/7.x.nix index 0817a7ab087ee..1abc0ff9bf82b 100644 --- a/pkgs/tools/misc/logstash/7.x.nix +++ b/pkgs/tools/misc/logstash/7.x.nix @@ -3,12 +3,13 @@ , lib, stdenv , fetchurl , makeWrapper +, nixosTests , jre }: with lib; -stdenv.mkDerivation rec { +let this = stdenv.mkDerivation rec { version = elk7Version; name = "logstash-${optionalString (!enableUnfree) "oss-"}${version}"; @@ -52,4 +53,12 @@ stdenv.mkDerivation rec { platforms = platforms.unix; maintainers = with maintainers; [ wjlroe offline basvandijk ]; }; -} + passthru.tests = + optionalAttrs (!enableUnfree) ( + assert this.drvPath == nixosTests.elk.ELK-7.elkPackages.logstash.drvPath; + { + elk = nixosTests.elk.ELK-7; + } + ); +}; +in this diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index fd86483198fa5..97781149901e7 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -5823,13 +5823,23 @@ in lockfileProgs = callPackage ../tools/misc/lockfile-progs { }; - logstash6 = callPackage ../tools/misc/logstash/6.x.nix { }; + logstash6 = callPackage ../tools/misc/logstash/6.x.nix { + # https://www.elastic.co/support/matrix#logstash-and-jvm + jre = jdk11_headless; + }; logstash6-oss = callPackage ../tools/misc/logstash/6.x.nix { enableUnfree = false; + # https://www.elastic.co/support/matrix#logstash-and-jvm + jre = jdk11_headless; + }; + logstash7 = callPackage ../tools/misc/logstash/7.x.nix { + # https://www.elastic.co/support/matrix#logstash-and-jvm + jre = jdk11_headless; }; - logstash7 = callPackage ../tools/misc/logstash/7.x.nix { }; logstash7-oss = callPackage ../tools/misc/logstash/7.x.nix { enableUnfree = false; + # https://www.elastic.co/support/matrix#logstash-and-jvm + jre = jdk11_headless; }; logstash = logstash6;