New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
zabbix.agent2: init at 5.0.5 #117538
zabbix.agent2: init at 5.0.5 #117538
Conversation
…compatible with both zabbix agent 1 and 2
Thanks again @tomberek 🎉 |
''; | ||
|
||
# run `go mod vendor` from the correct directory | ||
overrideModAttrs = (_oldAttrs : { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just setting modRoot = "src/go"
instead of overrideModAttrs
should work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately not because source code outside of this directory is needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to work?
diff --git a/pkgs/servers/monitoring/zabbix/agent2.nix b/pkgs/servers/monitoring/zabbix/agent2.nix
index f3c1be0f8e2..5f77528f48b 100644
--- a/pkgs/servers/monitoring/zabbix/agent2.nix
+++ b/pkgs/servers/monitoring/zabbix/agent2.nix
@@ -40,7 +40,7 @@ import ./versions.nix ({ version, sha256 }:
# we need to manipulate a number of things for their build
# system to properly work
buildPhase = ''
- cp -r vendor src/go/vendor
+ cd ../..
make
'';
@@ -49,12 +49,7 @@ import ./versions.nix ({ version, sha256 }:
install -Dm0755 src/go/bin/zabbix_agent2 $out/bin/zabbix_agent2
'';
- # run `go mod vendor` from the correct directory
- overrideModAttrs = (_oldAttrs : {
- preConfigure = ''
- cd src/go
- '';
- });
+ modRoot = "src/go";
meta = with lib; {
description = "An enterprise-class open source distributed monitoring solution (client-side agent)";
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's great! Thanks for taking a look. Would you be willing to make a PR? I can test.
|
||
vendorSha256 = "1kb3lc9jjv0cpzq93k1b9y496i95fcnwhb03j0gwlyqmgsa6yn81"; | ||
|
||
nativeBuildInputs = [ autoreconfHook pkg-config]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nativeBuildInputs = [ autoreconfHook pkg-config]; | |
nativeBuildInputs = [ autoreconfHook pkg-config ]; |
Motivation for this change
There is a drop in replacement for
zabbix.agent
:zabbix.agent2
. Whilezabbix.agent
was written inc
,zabbix.agent2
is mostly written ingo
with a bit ofc
glue.A massive thank you to @tomberek who packaged this with me. I was really lost on how to package this and he led me through the whole process. What a champion! 🚀
I ran a full set of tests on this today on a server that was running
zabbix.agent
, so testing was thorough 👍Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)