diff --git a/pkgs/tools/networking/dhcpcd/default.nix b/pkgs/tools/networking/dhcpcd/default.nix index 158097d7c166..ea79ea7d49dc 100644 --- a/pkgs/tools/networking/dhcpcd/default.nix +++ b/pkgs/tools/networking/dhcpcd/default.nix @@ -3,6 +3,7 @@ , fetchFromGitHub , pkg-config , udev +, freebsd , runtimeShellPackage , runtimeShell , nixosTests @@ -22,8 +23,12 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ pkg-config ]; buildInputs = [ - udev runtimeShellPackage # So patchShebangs finds a bash suitable for the installed scripts + ] ++ lib.optionals stdenv.isLinux [ + udev + ] ++ lib.optionals stdenv.isFreeBSD [ + freebsd.libcapsicum + freebsd.libcasper ]; postPatch = '' @@ -52,7 +57,7 @@ stdenv.mkDerivation rec { installFlags = [ "DBDIR=$(TMPDIR)/db" "SYSCONFDIR=${placeholder "out"}/etc" ]; # Check that the udev plugin got built. - postInstall = lib.optionalString (udev != null) "[ -e ${placeholder "out"}/lib/dhcpcd/dev/udev.so ]"; + postInstall = lib.optionalString (udev != null && stdenv.isLinux) "[ -e ${placeholder "out"}/lib/dhcpcd/dev/udev.so ]"; passthru = { inherit enablePrivSep; @@ -62,7 +67,7 @@ stdenv.mkDerivation rec { meta = with lib; { description = "A client for the Dynamic Host Configuration Protocol (DHCP)"; homepage = "https://roy.marples.name/projects/dhcpcd"; - platforms = platforms.linux; + platforms = platforms.linux ++ platforms.freebsd; license = licenses.bsd2; maintainers = with maintainers; [ eelco ]; mainProgram = "dhcpcd";