about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/misc/slstatus/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/applications/misc/slstatus/default.nix')
-rw-r--r--nixpkgs/pkgs/applications/misc/slstatus/default.nix46
1 files changed, 46 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/applications/misc/slstatus/default.nix b/nixpkgs/pkgs/applications/misc/slstatus/default.nix
new file mode 100644
index 000000000000..83407f94fcb6
--- /dev/null
+++ b/nixpkgs/pkgs/applications/misc/slstatus/default.nix
@@ -0,0 +1,46 @@
+{ lib
+, stdenv
+, fetchgit
+, pkg-config
+, writeText
+, libX11
+, libXau
+, libXdmcp
+, conf ? null
+, patches ? [ ]
+}:
+
+stdenv.mkDerivation rec {
+  pname = "slstatus";
+  version = "1.0";
+
+  src = fetchgit {
+    url = "https://git.suckless.org/slstatus";
+    rev = version;
+    hash = "sha256-cFah6EgApslLSlJaOy/5W9ZV9Z1lzfKye/rRh9Om3T4=";
+  };
+
+  preBuild =
+    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"}
+      makeFlagsArray+=(LDLIBS="-lX11 -lxcb -lXau -lXdmcp" CC=$CC)
+    '';
+
+  inherit patches;
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ libX11 libXau libXdmcp ];
+
+  installFlags = [ "PREFIX=$(out)" ];
+
+  meta = with lib; {
+    homepage = "https://tools.suckless.org/slstatus/";
+    description = "status monitor for window managers that use WM_NAME like dwm";
+    license = licenses.isc;
+    maintainers = with maintainers; [ oxzi ];
+    platforms = platforms.linux;
+  };
+}