nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib, stdenv, fetchFromGitHub, systemd, libnotify, pkg-config }:
2
3stdenv.mkDerivation rec {
4 pname = "psi-notify";
5 version = "1.3.1";
6
7 src = fetchFromGitHub {
8 owner = "cdown";
9 repo = pname;
10 rev = version;
11 sha256 = "sha256-GhGiSI5r0Ki6+MYNa5jCDyYZEW5R9LDNZ/S8K+6L0jo=";
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/lib/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}