tony / oxwm

Branch: bc68fc0
Switch branches/tags
master
tonybanters Zig port. e95e4af 2026-02-02
57 lines · 1.1 KB Raw Blame History
1 {
2 lib,
3 stdenv,
4 zig,
5 pkg-config,
6 xorg,
7 lua5_4,
8 freetype,
9 fontconfig,
10 gitRev ? "unknown",
11 }:
12 stdenv.mkDerivation (finalAttrs: {
13 pname = "oxwm";
14 version = "${lib.substring 0 8 gitRev}";
15
16 src = ./.;
17
18 nativeBuildInputs = [zig pkg-config];
19
20 buildInputs = [
21 xorg.libX11
22 xorg.libXinerama
23 xorg.libXft
24 lua5_4
25 freetype
26 fontconfig
27 ];
28
29 dontConfigure = true;
30
31 buildPhase = ''
32 runHook preBuild
33 zig build -Doptimize=ReleaseSafe --prefix $out
34 runHook postBuild
35 '';
36
37 installPhase = ''
38 runHook preInstall
39 install resources/oxwm.desktop -Dt $out/share/xsessions
40 install -Dm644 resources/oxwm.1 -t $out/share/man/man1
41 install -Dm644 templates/oxwm.lua -t $out/share/oxwm
42 runHook postInstall
43 '';
44
45 # tests require a running X server
46 doCheck = false;
47
48 passthru.providedSessions = ["oxwm"];
49
50 meta = {
51 description = "Dynamic window manager written in Zig, inspired by dwm";
52 homepage = "https://github.com/tonybanters/oxwm";
53 license = lib.licenses.gpl3Only;
54 platforms = lib.platforms.linux;
55 mainProgram = "oxwm";
56 };
57 })