From 2648e3fbf8a07529443ecfc84650d4788652283a Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Fri, 30 May 2025 14:53:16 +0200 Subject: [PATCH] dhcpcd: fix static I've stuck with checking isLinux rather than availableOn, because I think that even if we ended up with libudev-devd on FreeBSD, we still wouldn't want to use it in this package when it has its own FreeBSD support. --- pkgs/by-name/dh/dhcpcd/package.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/by-name/dh/dhcpcd/package.nix b/pkgs/by-name/dh/dhcpcd/package.nix index b6b814248050..27a290c8284f 100644 --- a/pkgs/by-name/dh/dhcpcd/package.nix +++ b/pkgs/by-name/dh/dhcpcd/package.nix @@ -8,6 +8,8 @@ runtimeShellPackage, runtimeShell, nixosTests, + # Always tries to do dynamic linking for udev. + withUdev ? stdenv.hostPlatform.isLinux && !stdenv.hostPlatform.isStatic, enablePrivSep ? false, }: @@ -27,7 +29,7 @@ stdenv.mkDerivation rec { [ runtimeShellPackage # So patchShebangs finds a bash suitable for the installed scripts ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ + ++ lib.optionals withUdev [ udev ] ++ lib.optionals stdenv.hostPlatform.isFreeBSD [ @@ -58,9 +60,7 @@ stdenv.mkDerivation rec { ]; # Check that the udev plugin got built. - postInstall = lib.optionalString ( - udev != null && stdenv.hostPlatform.isLinux - ) "[ -e ${placeholder "out"}/lib/dhcpcd/dev/udev.so ]"; + postInstall = lib.optionalString withUdev "[ -e ${placeholder "out"}/lib/dhcpcd/dev/udev.so ]"; passthru.tests = { inherit (nixosTests.networking.scripted)