oxwm

https://git.tonybtw.com/oxwm.git git://git.tonybtw.com/oxwm.git

nix: use zig build hook instead of manual build phase and fix installPhase

Commit
0e1568b4c1a0fd199fb4af8677922cb173d3ef08
Parent
bc68fc0
Author
emzywastaken <amiamemetoo@gmail.com>
Date
2026-02-15 18:41:31

Diff

diff --git a/default.nix b/default.nix
index 46e2a2d..d3eedaa 100644
--- a/default.nix
+++ b/default.nix
@@ -15,7 +15,7 @@ stdenv.mkDerivation (finalAttrs: {
 
   src = ./.;
 
-  nativeBuildInputs = [zig pkg-config];
+  nativeBuildInputs = [zig.hook pkg-config];
 
   buildInputs = [
     xorg.libX11
@@ -26,20 +26,10 @@ stdenv.mkDerivation (finalAttrs: {
     fontconfig
   ];
 
-  dontConfigure = true;
-
-  buildPhase = ''
-    runHook preBuild
-    zig build -Doptimize=ReleaseSafe --prefix $out
-    runHook postBuild
-  '';
-
-  installPhase = ''
-    runHook preInstall
+  postInstall = ''
     install resources/oxwm.desktop -Dt $out/share/xsessions
     install -Dm644 resources/oxwm.1 -t $out/share/man/man1
     install -Dm644 templates/oxwm.lua -t $out/share/oxwm
-    runHook postInstall
   '';
 
   # tests require a running X server