about summary refs log tree commit diff
path: root/pkgs/tools/networking/keepalived
diff options
context:
space:
mode:
authorNick Cao <nickcao@nichi.co>2023-12-30 11:12:25 -0500
committerNick Cao <nickcao@nichi.co>2023-12-30 11:12:25 -0500
commitb04954bf143a2e5feb3937acd3a0886571d94d35 (patch)
tree90f188bf9f0cf6a6fbfe97a890763890d8cdd20e /pkgs/tools/networking/keepalived
parent2961883989ee0cf109342720e2123cd3f50043d1 (diff)
keepalived: disable net-snmp support when cross compiling
net-snmp support requires running net-snmp-config which is not
executable on build platform
Diffstat (limited to 'pkgs/tools/networking/keepalived')
-rw-r--r--pkgs/tools/networking/keepalived/default.nix24
1 files changed, 18 insertions, 6 deletions
diff --git a/pkgs/tools/networking/keepalived/default.nix b/pkgs/tools/networking/keepalived/default.nix
index 0b2371192d38c..c20722aa507ce 100644
--- a/pkgs/tools/networking/keepalived/default.nix
+++ b/pkgs/tools/networking/keepalived/default.nix
@@ -1,7 +1,17 @@
-{ lib, stdenv, fetchFromGitHub, nixosTests
-, file, libmnl, libnftnl, libnl
-, net-snmp, openssl, pkg-config
-, autoreconfHook }:
+{ lib
+, stdenv
+, fetchFromGitHub
+, nixosTests
+, file
+, libmnl
+, libnftnl
+, libnl
+, net-snmp
+, openssl
+, pkg-config
+, autoreconfHook
+, withNetSnmp ? stdenv.buildPlatform.canExecute stdenv.hostPlatform
+}:
 
 stdenv.mkDerivation rec {
   pname = "keepalived";
@@ -19,8 +29,9 @@ stdenv.mkDerivation rec {
     libmnl
     libnftnl
     libnl
-    net-snmp
     openssl
+  ] ++ lib.optionals withNetSnmp [
+    net-snmp
   ];
 
   enableParallelBuilding = true;
@@ -31,8 +42,9 @@ stdenv.mkDerivation rec {
 
   configureFlags = [
     "--enable-sha1"
+  ] ++ lib.optionals withNetSnmp [
     "--enable-snmp"
- ];
+  ];
 
   meta = with lib; {
     homepage = "https://keepalived.org";