From 159be7791c43ec5b3db0403bf47373981a6d7f9f Mon Sep 17 00:00:00 2001 From: happysalada Date: Mon, 30 Aug 2021 22:50:10 +0900 Subject: [PATCH] logstash: fix download url Update pkgs/tools/misc/logstash/7.x.nix Co-authored-by: Mihai Fufezan <36706276+fufexan@users.noreply.github.com> Update pkgs/tools/misc/logstash/7.x.nix Co-authored-by: Mihai Fufezan <36706276+fufexan@users.noreply.github.com> --- pkgs/development/tools/misc/kibana/7.x.nix | 4 +-- pkgs/tools/misc/logstash/7.x.nix | 32 ++++++++++++++-------- 2 files changed, 23 insertions(+), 13 deletions(-) diff --git a/pkgs/development/tools/misc/kibana/7.x.nix b/pkgs/development/tools/misc/kibana/7.x.nix index fdfe655b8341..a2b6f740db4c 100644 --- a/pkgs/development/tools/misc/kibana/7.x.nix +++ b/pkgs/development/tools/misc/kibana/7.x.nix @@ -29,11 +29,11 @@ let in stdenv.mkDerivation rec { - name = "kibana-${optionalString (!enableUnfree) "oss-"}${version}"; + pname = "kibana${optionalString (!enableUnfree) "-oss"}"; version = elk7Version; src = fetchurl { - url = "https://artifacts.elastic.co/downloads/kibana/${name}-${plat}-${arch}.tar.gz"; + url = "https://artifacts.elastic.co/downloads/kibana/${pname}-${version}-${plat}-${arch}.tar.gz"; sha256 = shas.${stdenv.hostPlatform.system} or (throw "Unknown architecture"); }; diff --git a/pkgs/tools/misc/logstash/7.x.nix b/pkgs/tools/misc/logstash/7.x.nix index 13f926d851a3..83a063c125ef 100644 --- a/pkgs/tools/misc/logstash/7.x.nix +++ b/pkgs/tools/misc/logstash/7.x.nix @@ -10,17 +10,28 @@ with lib; -let this = stdenv.mkDerivation rec { - # FIXME 7.10 is not available on the mirror - version = "7.9.3"; - name = "logstash-${optionalString (!enableUnfree) "oss-"}${version}"; +let + info = splitString "-" stdenv.hostPlatform.system; + arch = elemAt info 0; + plat = elemAt info 1; + shas = + if enableUnfree + then { + x86_64-linux = "sha256-5qv4fbFpLf6aduD7wyxXQ6FsCeUqrszRisNBx44vbMY="; + x86_64-darwin = "sha256-7H+Xpo8qF1ZZMkR5n92PVplEN4JsBEYar91zHQhE+Lo="; + } + else { + x86_64-linux = "sha256-jiV2yGPwPgZ5plo3ftImVDLSOsk/XBzFkeeALSObLhU="; + x86_64-darwin = "sha256-UYG+GGr23eAc2GgNX/mXaGU0WKMjiQMPpD1wUvAVz0A="; + }; +in +stdenv.mkDerivation rec { + version = elk7Version; + pname = "logstash${optionalString (!enableUnfree) "-oss"}"; src = fetchurl { - url = "https://artifacts.elastic.co/downloads/logstash/${name}.tar.gz"; - sha256 = - if enableUnfree - then "sha256-YM17/LqsMLH15YZp+0pqbEUzmAcCUpIwWT7o+MJN1QE=" - else "sha256-5HEs/2bi8m64P0R8aHGgyFJCqiFxs1aBF59Wzg9STCM="; + url = "https://artifacts.elastic.co/downloads/logstash/${pname}-${version}-${plat}-${arch}.tar.gz"; + sha256 = shas.${stdenv.hostPlatform.system} or (throw "Unknown architecture"); }; dontBuild = true; @@ -63,5 +74,4 @@ let this = stdenv.mkDerivation rec { elk = nixosTests.elk.ELK-7; } ); -}; -in this +}