1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 autoreconfHook,
6 pkg-config,
7 libqb,
8 usbguard,
9 librsvg,
10 libnotify,
11 catch2,
12 asciidoc,
13}:
14
15stdenv.mkDerivation rec {
16 pname = "usbguard-notifier";
17 version = "0.1.0";
18
19 src = fetchFromGitHub {
20 owner = "Cropi";
21 repo = pname;
22 rev = "${pname}-${version}";
23 hash = "sha256-gWvCGSbOuey2ELAPD2WCG4q77IClL0S7rE2RaUJDc1I=";
24 };
25
26 nativeBuildInputs = [ autoreconfHook pkg-config asciidoc ];
27 buildInputs = [ libqb usbguard librsvg libnotify ];
28
29 configureFlags = [ "CPPFLAGS=-I${catch2}/include/catch2" ];
30
31 prePatch = ''
32 substituteInPlace configure.ac \
33 --replace 'AC_MSG_FAILURE([Cannot detect the systemd system unit dir])' \
34 'systemd_unit_dir="$out/lib/systemd/user"'
35 '';
36
37 meta = {
38 description = "Notifications for detecting usbguard policy and device presence changes";
39 homepage = "https://github.com/Cropi/usbguard-notifier";
40 maintainers = with lib.maintainers; [ fpletz ];
41 platforms = lib.platforms.linux;
42 license = lib.licenses.gpl2Plus;
43 };
44}