{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, glib, ncurses, libcap_ng }:

stdenv.mkDerivation rec {
  name = "irqbalance-${version}";
  version = "1.3.0";

  src = fetchFromGitHub {
    owner = "irqbalance";
    repo = "irqbalance";
    rev = "v${version}";
    sha256 = "009777p5v72x4r58skqgaf03qv3app9b8lkxkpxq0226l0x3j4qh";
  };

  nativeBuildInputs = [ autoreconfHook pkgconfig ];
  buildInputs = [ glib ncurses libcap_ng ];

  LDFLAGS = "-lncurses";

  meta = {
    homepage = https://github.com/Irqbalance/irqbalance;
    description = "A daemon to help balance the cpu load generated by interrupts across all of a systems cpus";
    license = stdenv.lib.licenses.gpl2;
    platforms = stdenv.lib.platforms.linux;
  };
}
