summaryrefslogtreecommitdiff
path: root/packages/dwl.nix
diff options
context:
space:
mode:
authorRaghuram Subramani <raghus2247@gmail.com>2024-02-02 15:55:42 +0530
committerRaghuram Subramani <raghus2247@gmail.com>2024-02-02 15:55:42 +0530
commit5055c72d26569d352b0273cd79544ece594763b2 (patch)
treecc2b5744e67e9a8e9c4294d3a3e0a1769a61d83f /packages/dwl.nix
parent4803f1aac7f36c45c392b50869cd91d097e413c9 (diff)
remove dwlb
Diffstat (limited to 'packages/dwl.nix')
-rw-r--r--packages/dwl.nix97
1 files changed, 97 insertions, 0 deletions
diff --git a/packages/dwl.nix b/packages/dwl.nix
new file mode 100644
index 0000000..b422292
--- /dev/null
+++ b/packages/dwl.nix
@@ -0,0 +1,97 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, installShellFiles
+, libX11
+, libinput
+, libxcb
+, libxkbcommon
+, pixman
+, pkg-config
+, substituteAll
+, wayland-scanner
+, wayland
+, wayland-protocols
+, wlroots
+, writeText
+, xcbutilwm
+, xwayland
+, enableXWayland ? true
+, conf ? null
+}:
+
+stdenv.mkDerivation (finalAttrs: {
+ pname = "dwl";
+ version = "0.5";
+
+ src = fetchFromGitHub {
+ owner = "compromyse";
+ repo = "dwl";
+ rev = "master";
+ hash = "sha256-Cm6EPr2h8iSBXAc+9Yqendsp0c0b9BHDgYwaQT/t4/A=";
+ };
+
+ nativeBuildInputs = [
+ installShellFiles
+ pkg-config
+ wayland-scanner
+ ];
+
+ buildInputs = [
+ libinput
+ libxcb
+ libxkbcommon
+ pixman
+ wayland
+ wayland-protocols
+ wlroots
+ ] ++ lib.optionals enableXWayland [
+ libX11
+ xcbutilwm
+ xwayland
+ ];
+
+ outputs = [ "out" "man" ];
+
+ # Allow users to set an alternative config.def.h
+ postPatch = let
+ configFile = if lib.isDerivation conf || builtins.isPath conf
+ then conf
+ else writeText "config.def.h" conf;
+ in lib.optionalString (conf != null) "cp ${configFile} config.def.h";
+
+ makeFlags = [
+ "PKG_CONFIG=${stdenv.cc.targetPrefix}pkg-config"
+ "WAYLAND_SCANNER=wayland-scanner"
+ "PREFIX=$(out)"
+ "MANDIR=$(man)/share/man"
+ ];
+
+ preBuild = ''
+ makeFlagsArray+=(
+ XWAYLAND=${lib.optionalString enableXWayland "-DXWAYLAND"}
+ XLIBS=${lib.optionalString enableXWayland "xcb\\ xcb-icccm"}
+ )
+ '';
+
+ meta = {
+ homepage = "https://github.com/djpohly/dwl/";
+ description = "Dynamic window manager for Wayland";
+ longDescription = ''
+ dwl is a compact, hackable compositor for Wayland based on wlroots. It is
+ intended to fill the same space in the Wayland world that dwm does in X11,
+ primarily in terms of philosophy, and secondarily in terms of
+ functionality. Like dwm, dwl is:
+
+ - Easy to understand, hack on, and extend with patches
+ - One C source file (or a very small number) configurable via config.h
+ - Limited to 2000 SLOC to promote hackability
+ - Tied to as few external dependencies as possible
+ '';
+ changelog = "https://github.com/djpohly/dwl/releases/tag/v${finalAttrs.version}";
+ license = lib.licenses.gpl3Only;
+ maintainers = [ lib.maintainers.AndersonTorres ];
+ inherit (wayland.meta) platforms;
+ mainProgram = "dwl";
+ };
+})