nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 systemd,
6 libnotify,
7 pkg-config,
8}:
9
10stdenv.mkDerivation (finalAttrs: {
11 pname = "psi-notify";
12 version = "1.3.1";
13
14 src = fetchFromGitHub {
15 owner = "cdown";
16 repo = "psi-notify";
17 rev = finalAttrs.version;
18 sha256 = "sha256-GhGiSI5r0Ki6+MYNa5jCDyYZEW5R9LDNZ/S8K+6L0jo=";
19 };
20
21 buildInputs = [
22 systemd
23 libnotify
24 ];
25 nativeBuildInputs = [ pkg-config ];
26
27 installPhase = ''
28 runHook preInstall
29
30 install -D psi-notify $out/bin/psi-notify
31 substituteInPlace psi-notify.service --replace psi-notify $out/bin/psi-notify
32 install -D psi-notify.service $out/lib/systemd/user/psi-notify.service
33
34 runHook postInstall
35 '';
36
37 meta = {
38 description = "Alert on system resource saturation";
39 longDescription = ''
40 psi-notify can alert you when resources on your machine are becoming
41 oversaturated, and allow you to take action before your system slows to a
42 crawl.
43 '';
44 license = lib.licenses.mit;
45 homepage = "https://github.com/cdown/psi-notify";
46 platforms = lib.platforms.linux;
47 maintainers = with lib.maintainers; [ eduarrrd ];
48 mainProgram = "psi-notify";
49 };
50})