12 stdenv.mkDerivation rec {
17 url = "mirror://roy/${pname}/${pname}-${version}.tar.xz";
18 sha256 = "sha256-gZNXY07+0epc9E7AGyTT0/iFL+yLQkmSXcxWZ8VON2w=";
21 nativeBuildInputs = [ pkg-config ];
24 runtimeShellPackage # So patchShebangs finds a bash suitable for the installed scripts
28 substituteInPlace hooks/dhcpcd-run-hooks.in --replace /bin/sh ${runtimeShell}
31 preConfigure = "patchShebangs ./configure";
35 "--localstatedir=/var"
39 then [ "--disable-privsep" ]
42 # dhcpcd disables privsep if it can't find the default user,
43 # so we explicitly specify a user.
44 "--privsepuser=dhcpcd"
48 makeFlags = [ "PREFIX=${placeholder "out"}" ];
50 # Hack to make installation succeed. dhcpcd will still use /var/db
52 installFlags = [ "DBDIR=$(TMPDIR)/db" "SYSCONFDIR=${placeholder "out"}/etc" ];
54 # Check that the udev plugin got built.
55 postInstall = lib.optionalString (udev != null) "[ -e ${placeholder "out"}/lib/dhcpcd/dev/udev.so ]";
58 inherit enablePrivSep;
59 tests = { inherit (nixosTests.networking.scripted) macvlan dhcpSimple dhcpOneIf; };
63 description = "A client for the Dynamic Host Configuration Protocol (DHCP)";
64 homepage = "https://roy.marples.name/projects/dhcpcd";
65 platforms = platforms.linux;
66 license = licenses.bsd2;
67 maintainers = with maintainers; [ eelco ];