@@ -0,0 +1,39 @@
1+{ lib, stdenv, fetchFromGitHub, systemd, libnotify, pkg-config }:
2+
3+stdenv.mkDerivation rec {
4+ pname = "psi-notify";
5+ version = "1.2.1";
6+
7+ src = fetchFromGitHub {
8+ owner = "cdown";
9+ repo = pname;
10+ rev = version;
11+ sha256 = "0hn37plim1smmlrjjmz8kybyms8pz3wxcgf8vmqjrsqi6bfcym7g";
12+ };
13+
14+ buildInputs = [ systemd libnotify ];
15+ nativeBuildInputs = [ pkg-config ];
16+
17+ installPhase = ''
18+ runHook preInstall
19+
20+ install -D psi-notify $out/bin/psi-notify
21+ substituteInPlace psi-notify.service --replace psi-notify $out/bin/psi-notify
22+ install -D psi-notify.service $out/share/systemd/user/psi-notify.service
23+
24+ runHook postInstall
25+ '';
26+
27+ meta = with lib; {
28+ description = "Alert on system resource saturation";
29+ longDescription = ''
30+ psi-notify can alert you when resources on your machine are becoming
31+ oversaturated, and allow you to take action before your system slows to a
32+ crawl.
33+ '';
34+ license = licenses.mit;
35+ homepage = "https://github.com/cdown/psi-notify";
36+ platforms = platforms.linux;
37+ maintainers = with maintainers; [ eduarrrd ];
38+ };
39+}