From 5149c67e6e8150c6beed511181e30d54b2057e72 Mon Sep 17 00:00:00 2001 From: adisbladis Date: Wed, 24 Aug 2022 11:56:19 +0800 Subject: [PATCH] Enable Cgo by default To be in line with the behaviour of buildGoModule since https://github.com/NixOS/nixpkgs/pull/177594. --- builder/default.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/builder/default.nix b/builder/default.nix index 90ef1d0..7ce54a3 100644 --- a/builder/default.nix +++ b/builder/default.nix @@ -172,6 +172,8 @@ let dontConfigure = true; dontInstall = true; + CGO_ENABLED = attrs.CGO_ENABLED or go.CGO_ENABLED; + propagatedBuildInputs = [ go ]; GO_NO_VENDOR_CHECKS = "1"; @@ -253,6 +255,7 @@ let inherit (go) GOOS GOARCH; GO_NO_VENDOR_CHECKS = "1"; + CGO_ENABLED = attrs.CGO_ENABLED or go.CGO_ENABLED; GO111MODULE = "on"; GOFLAGS = [ "-mod=vendor" ] ++ lib.optionals (!allowGoReference) [ "-trimpath" ];