summary refs log tree commit diff
path: root/pkgs/tools/misc/bsp-layout/default.nix
blob: bad5b4d9a89fe8941dad3147378eac8084f802f8 (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
44
45
{ lib
, stdenv
, fetchFromGitHub
, makeWrapper
, git
, bc
, bspwm
}:

stdenv.mkDerivation rec {
  pname = "bsp-layout";
  version = "unstable-2021-05-10";

  src = fetchFromGitHub {
    owner = "phenax";
    repo = pname;
    rev = "726b850b79eabdc6f4d236cff52e434848cb55e3";
    sha256 = "1wqlzbz7l9vz37gin2zckrnxkkabnd7x5mi9pb0x96w4yhld5mx6";
  };

  nativeBuildInputs = [ makeWrapper git bc ];
  buildInputs = [ bspwm ];

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

  postInstall = ''
    substituteInPlace $out/lib/bsp-layout/layout.sh --replace 'bc ' '${bc}/bin/bc '
    for layout in tall rtall wide rwide
    do
      substituteInPlace "$out/lib/bsp-layout/layouts/$layout.sh" --replace 'bc ' '${bc}/bin/bc '
    done
  '';

  meta = with lib; {
    description = "Manage layouts in bspwm";
    longDescription = ''
      bsp-layout is a dynamic layout manager for bspwm, written in bash.
      It provides layout options to fit most workflows.
    '';
    homepage = "https://github.com/phenax/bsp-layout";
    license = licenses.mit;
    maintainers = with maintainers; [ devins2518 totoroot ];
    platforms = platforms.linux;
  };
}