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.
This commit is contained in:
Alyssa Ross
2025-06-05 15:29:47 +02:00
parent 154cedf1f4
commit 2648e3fbf8
+4 -4
View File
@@ -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)