1{ lib, stdenv, fetchFromGitHub, libX11, patches ? [ ], writeText, conf ? null }:
2
3stdenv.mkDerivation {
4 pname = "dwmblocks";
5 version = "unstable-2020-12-27";
6
7 src = fetchFromGitHub {
8 owner = "torrinfail";
9 repo = "dwmblocks";
10 rev = "96cbb453e5373c05372fd4bf3faacfa53e409067";
11 sha256 = "00lxfxsrvhm60zzqlcwdv7xkqzya69mgpi2mr3ivzbc8s9h8nwqx";
12 };
13
14 buildInputs = [ libX11 ];
15
16 inherit patches;
17
18 postPatch =
19 let
20 configFile =
21 if lib.isDerivation conf || builtins.isPath conf
22 then conf else writeText "blocks.def.h" conf;
23 in
24 lib.optionalString (conf != null) "cp ${configFile} blocks.def.h";
25
26 makeFlags = [ "PREFIX=$(out)" ];
27
28 meta = with lib; {
29 description = "Modular status bar for dwm written in c";
30 homepage = "https://github.com/torrinfail/dwmblocks";
31 license = licenses.isc;
32 maintainers = with maintainers; [ sophrosyne ];
33 platforms = platforms.linux;
34 };
35}