lol
1{ lib
2, fetchFromGitLab
3, buildPythonApplication
4, dbus-python
5, pygobject3
6, systemd
7, wirelesstools
8}:
9
10buildPythonApplication rec {
11 pname = "networkd-notify";
12 version = "unstable-2022-11-29";
13 # There is no setup.py, just a single Python script.
14 format = "other";
15
16 src = fetchFromGitLab {
17 owner = "wavexx";
18 repo = pname;
19 rev = "c2f3e71076a0f51c097064b1eb2505a361c7cc0e";
20 sha256 = "sha256-fanP1EWERT2Jy4OnMo8OMdR9flginYUgMw+XgmDve3o=";
21 };
22
23 propagatedBuildInputs = [
24 dbus-python
25 pygobject3
26 ];
27
28 patchPhase = ''
29 sed -i \
30 -e '/^NETWORKCTL = /c\NETWORKCTL = ["${systemd}/bin/networkctl"]' \
31 -e '/^IWCONFIG = /c\IWCONFIG = ["${wirelesstools}/bin/iwconfig"]' \
32 networkd-notify
33 '';
34
35 dontBuild = true;
36
37 installPhase = ''
38 install -D networkd-notify -t "$out/bin/"
39 install -D -m0644 networkd-notify.desktop -t "$out/share/applications/"
40 '';
41
42 meta = with lib; {
43 description = "Desktop notification integration for systemd-networkd";
44 homepage = "https://gitlab.com/wavexx/networkd-notify";
45 maintainers = with maintainers; [ danc86 ];
46 license = licenses.gpl3;
47 platforms = platforms.linux;
48 };
49}