From b5aefcd40a4c5a0db8275e72fd18018a9d94b77b Mon Sep 17 00:00:00 2001 From: nicoo Date: Sun, 15 Sep 2024 21:47:29 +0000 Subject: [PATCH] fetchgx: support `hash` attribute --- pkgs/build-support/fetchgx/default.nix | 45 +++++++++++++------------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/pkgs/build-support/fetchgx/default.nix b/pkgs/build-support/fetchgx/default.nix index 93f60c0a9cac..5726e7d4e9f1 100644 --- a/pkgs/build-support/fetchgx/default.nix +++ b/pkgs/build-support/fetchgx/default.nix @@ -1,30 +1,31 @@ -{ stdenvNoCC, gx, gx-go, go, cacert }: +{ lib, stdenvNoCC, gx, gx-go, go, cacert }: -{ name, src, sha256 }: +lib.fetchers.withNormalizedHash { } ( + { name, src, outputHash, outputHashAlgo }: -stdenvNoCC.mkDerivation { - name = "${name}-gxdeps"; - inherit src; + stdenvNoCC.mkDerivation { + name = "${name}-gxdeps"; + inherit src; - nativeBuildInputs = [ cacert go gx gx-go ]; + nativeBuildInputs = [ cacert go gx gx-go ]; - outputHashAlgo = "sha256"; - outputHashMode = "recursive"; - outputHash = sha256; + inherit outputHash outputHashAlgo; + outputHashMode = "recursive"; - dontConfigure = true; - doCheck = false; - doInstallCheck = false; + dontConfigure = true; + doCheck = false; + doInstallCheck = false; - buildPhase = '' - export GOPATH=$(pwd)/vendor - mkdir -p vendor - gx install - ''; + buildPhase = '' + export GOPATH=$(pwd)/vendor + mkdir -p vendor + gx install + ''; - installPhase = '' - mv vendor $out - ''; + installPhase = '' + mv vendor $out + ''; - preferLocalBuild = true; -} + preferLocalBuild = true; + } +)