grafana-agent: fix building of go-modules.drv from scratch

Unbreaks building the go-modules.drv from source (read: not substituted
from cache.nixos.org).

Regression from cc4dcc08be
This commit is contained in:
emilylange 2023-08-30 15:54:34 +02:00
parent e7f38be377
commit 9bf8e19e02
No known key found for this signature in database
GPG key ID: 0AD773CE46FD0F87

View file

@ -70,6 +70,12 @@ buildGoModule rec {
popd
'';
# do not pass preBuild to go-modules.drv, as it would otherwise fail to build.
# but even if it would work, it simply isn't needed in that scope.
overrideModAttrs = (_: {
preBuild = null;
});
# uses go-systemd, which uses libsystemd headers
# https://github.com/coreos/go-systemd/issues/351
env.NIX_CFLAGS_COMPILE = toString (lib.optionals stdenv.isLinux [ "-I${lib.getDev systemd}/include" ]);