11 , withSystemd ? lib.meta.availableOn stdenv.hostPlatform systemd, systemd
12 , withUsb ? stdenv.isLinux, libusb1
15 stdenv.mkDerivation rec {
19 src = fetchFromGitHub {
23 hash = "sha256-djcp3b0OSnyrNOkvaacjQ3Nw9H54HOfKeBo26tkz/Ew=";
27 sed -i '2i echo ${version}; exit' tools/version.sh
28 sed -i '2i exit' tools/get_libfmt
31 nativeBuildInputs = [ autoreconfHook pkg-config indent perl ];
33 buildInputs = [ fmt_9 libev ]
34 ++ lib.optional withSystemd systemd
35 ++ lib.optional withUsb libusb1
36 ++ lib.optional stdenv.isDarwin argp-standalone;
38 configureFlags = lib.optional (!withSystemd) "--disable-systemd"
39 ++ lib.optional (!withUsb) "--disable-usb";
41 installFlags = lib.optionals withSystemd [
42 "systemdsystemunitdir=$(out)/lib/systemd/system"
43 "systemdsysusersdir=$(out)/lib/sysusers.d"
47 description = "Advanced router/gateway for KNX";
48 homepage = "https://github.com/knxd/knxd";
49 license = licenses.gpl2Plus;
50 maintainers = with maintainers; [ sikmir ];
51 platforms = platforms.unix;