nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib, stdenv, fetchFromGitHub
2, libX11 }:
3
4stdenv.mkDerivation rec {
5 pname = "tinywm";
6 version = "2014-04-22";
7
8 src = fetchFromGitHub {
9 owner = "mackstann";
10 repo = pname;
11 rev = "9d05612f41fdb8bc359f1fd9cc930bf16315abb1";
12 sha256 = "1s7r4f2d3lk1i8h089v2vyrr02hh0y9i3ihl9kqgk9s87hqw8q5b";
13 };
14
15 buildInputs = [ libX11 ];
16
17 dontConfigure = true;
18
19 buildPhase = ''
20 $CC -Wall -pedantic -I${libX11}/include tinywm.c -L${libX11}/lib -lX11 -o tinywm
21 '';
22
23 installPhase = ''
24 install -dm755 $out/bin $out/share/doc/${pname}-${version}
25 install -m755 tinywm -t $out/bin/
26 # The annotated source code is a piece of documentation
27 install -m644 annotated.c README -t $out/share/doc/${pname}-${version}
28 '';
29
30 meta = with lib;{
31 description = "A tiny window manager for X11";
32 longDescription = ''
33
34 TinyWM is a tiny window manager that I created as an exercise in
35 minimalism. It is also maybe helpful in learning some of the very basics
36 of creating a window manager. It is only around 50 lines of C. There is
37 also a Python version using python-xlib.
38
39 It lets you do four basic things:
40
41 - Move windows interactively with Alt+Button1 drag (left mouse button)
42 - Resize windows interactively with Alt+Button3 drag (right mouse button)
43 - Raise windows with Alt+F1 (not high on usability I know, but I needed a
44 keybinding in there somewhere)
45 - Focus windows with the mouse pointer (X does this on its own)
46 '';
47 homepage = "http://incise.org/tinywm.html";
48 maintainers = with maintainers; [ AndersonTorres ];
49 platforms = libX11.meta.platforms;
50 license = licenses.publicDomain;
51 };
52}