summaryrefslogtreecommitdiff
path: root/derivations/lowbat/default.nix
blob: 02ff1117f1fca47491b20b586f42a623ed542063 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
{ pkgs ? import <nixpkgs> {} }:

pkgs.stdenv.mkDerivation rec {
  pname = "lowbat";
  version = "1.2.1";

  src = pkgs.fetchzip {
    url = "https://git.tjkeller.xyz/${pname}/snapshot/${pname}-${version}.tar.xz";
    sha256 = "sha256-xsUHdmicHX/fQQgojVjWfzI82e4NezkmlACOpdPxLE0=";
  };

  nativeBuildInputs = [ pkgs.pkg-config ];
  buildInputs = [ pkgs.libnotify pkgs.glib ];

  buildPhase = ''
    make
  '';

  installPhase = ''
    mkdir -p $out/bin $out/share/man/man1
    cp lowbat $out/bin/
    cp lowbat.1 $out/share/man/man1/
  '';

  meta = with pkgs.lib; {
    description = "A minimal battery level monitor daemon, written in C";
    license = licenses.mit;
    maintainers = [ maintainers.tjkeller ];
  };
}