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