From 55be94fd284917dd7465f246c15e9dc4f3395f3d Mon Sep 17 00:00:00 2001
From: 06kellyjac <dev@j-k.io>
Date: Fri, 13 Nov 2020 18:51:06 +0000
Subject: [PATCH] open-policy-agent: move to buildGoModule

Move from buildGoPackage to buildGoModule since opa is a go module.
---
 .../tools/open-policy-agent/default.nix           | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/pkgs/development/tools/open-policy-agent/default.nix b/pkgs/development/tools/open-policy-agent/default.nix
index d6dbbcc493db..7be36021b42a 100644
--- a/pkgs/development/tools/open-policy-agent/default.nix
+++ b/pkgs/development/tools/open-policy-agent/default.nix
@@ -1,10 +1,9 @@
-{ lib, buildGoPackage, fetchFromGitHub }:
+{ lib, buildGoModule, fetchFromGitHub }:
 
-buildGoPackage rec {
+buildGoModule rec {
   pname = "open-policy-agent";
   version = "0.24.0";
 
-  goPackagePath = "github.com/open-policy-agent/opa";
   src = fetchFromGitHub {
     owner = "open-policy-agent";
     repo = "opa";
@@ -12,12 +11,14 @@ buildGoPackage rec {
     sha256 = "0fv2rq8a01hapcpgfqp71v113iyyzs5w1sam14h9clyr1vqrbcf2";
   };
 
+  vendorSha256 = null;
+
   subPackages = [ "." ];
 
-  buildFlagsArray = ''
-    -ldflags=
-      -X ${goPackagePath}/version.Version=${version}
-  '';
+  buildFlagsArray = [
+    "-ldflags="
+    "-X github.com/open-policy-agent/opa/version.Version=${version}"
+  ];
 
   meta = with lib; {
     description = "General-purpose policy engine";