about summary refs log tree commit diff
path: root/pkgs/tools/networking/keepalived
diff options
context:
space:
mode:
authorRick van Schijndel <Mindavi@users.noreply.github.com>2024-02-13 16:12:15 +0100
committerGitHub <noreply@github.com>2024-02-13 16:12:15 +0100
commita8304edc8c3cdabeadbb64b1822f4caa3c54dbcf (patch)
tree5ae6ee17ffd8265d71a3871539a9eae311a63097 /pkgs/tools/networking/keepalived
parent9323295d45b01862202685b1802db1f909417210 (diff)
parentb04954bf143a2e5feb3937acd3a0886571d94d35 (diff)
Merge pull request #277744 from NickCao/keepalived
keepalived: disable net-snmp support when cross compiling
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 02424d92de575..80059a664549a 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";