summary refs log tree commit diff
path: root/pkgs/applications/misc/slstatus/default.nix
blob: 4f022d81f62cd899143b086387c05a2e46b2326e (plain) (blame)
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
31
32
33
34
35
36
37
38
39
40
41
42
43
{ lib
, stdenv
, fetchgit
, pkg-config
, writeText
, libX11
, libXau
, libXdmcp
, conf ? null
, patches ? []
}:

stdenv.mkDerivation rec {
  pname = "slstatus";
  version = "unstable-2022-12-19";

  src = fetchgit {
    url = "https://git.suckless.org/slstatus";
    rev = "c919def84fd4f52f501548e5f7705b9d56dd1459";
    hash = "sha256-nEIHIO8CAYdtX8GniO6GDEaHj7kEu81b05nCMVdr2SE=";
  };

  configFile = lib.optionalString (conf!=null) (writeText "config.def.h" conf);
  preBuild = ''
    ${lib.optionalString (conf!=null) "cp ${configFile} config.def.h"}
    makeFlagsArray+=(LDLIBS="-lX11 -lxcb -lXau -lXdmcp" CC=$CC)
  '';

  inherit patches;

  nativeBuildInputs = [ pkg-config ];
  buildInputs = [ libX11 libXau libXdmcp];

  installFlags = [ "PREFIX=$(out)" ];

  meta = with lib; {
    homepage = "https://tools.suckless.org/slstatus/";
    description = "status monitor for window managers that use WM_NAME like dwm";
    license = licenses.isc;
    maintainers = with maintainers; [ oxzi ];
    platforms = platforms.linux;
  };
}