summary refs log tree commit diff
path: root/pkgs/applications
diff options
context:
space:
mode:
authorMichael Raskin <7c6f434c@mail.ru>2018-04-04 13:44:56 +0000
committerGitHub <noreply@github.com>2018-04-04 13:44:56 +0000
commit63c6c2dbdc4a63a0a5f4b8eb9642bb9fe69f387e (patch)
tree9d5ff97ffe2d883bca28038cdc951bcccdfb9d88 /pkgs/applications
parentfcbe4afe184b4cd137848a775decc420571b745a (diff)
parent26a4e02e956ed287bc85f2b0f729a79343f0be92 (diff)
downloadnixlib-63c6c2dbdc4a63a0a5f4b8eb9642bb9fe69f387e.tar
nixlib-63c6c2dbdc4a63a0a5f4b8eb9642bb9fe69f387e.tar.gz
nixlib-63c6c2dbdc4a63a0a5f4b8eb9642bb9fe69f387e.tar.bz2
nixlib-63c6c2dbdc4a63a0a5f4b8eb9642bb9fe69f387e.tar.lz
nixlib-63c6c2dbdc4a63a0a5f4b8eb9642bb9fe69f387e.tar.xz
nixlib-63c6c2dbdc4a63a0a5f4b8eb9642bb9fe69f387e.tar.zst
nixlib-63c6c2dbdc4a63a0a5f4b8eb9642bb9fe69f387e.zip
Merge pull request #36785 from Ma27/configurable-rofi-theme
rofi: add `theme` option
Diffstat (limited to 'pkgs/applications')
-rw-r--r--pkgs/applications/misc/rofi/default.nix6
-rw-r--r--pkgs/applications/misc/rofi/wrapper.nix17
2 files changed, 20 insertions, 3 deletions
diff --git a/pkgs/applications/misc/rofi/default.nix b/pkgs/applications/misc/rofi/default.nix
index f291060a10f2..7da721e9f374 100644
--- a/pkgs/applications/misc/rofi/default.nix
+++ b/pkgs/applications/misc/rofi/default.nix
@@ -5,10 +5,10 @@
 
 stdenv.mkDerivation rec {
   version = "1.5.1";
-  name = "rofi-${version}";
+  name = "rofi-unwrapped-${version}";
 
   src = fetchurl {
-    url = "https://github.com/DaveDavenport/rofi/releases/download/${version}/${name}.tar.gz";
+    url = "https://github.com/DaveDavenport/rofi/releases/download/${version}/rofi-${version}.tar.gz";
     sha256 = "1dc33zf33z38jcxb0lxpyd31waalpf6d4cd9z5f9m5qphdk1g679";
   };
 
@@ -36,7 +36,7 @@ stdenv.mkDerivation rec {
     description = "Window switcher, run dialog and dmenu replacement";
     homepage = https://davedavenport.github.io/rofi;
     license = licenses.mit;
-    maintainers = with maintainers; [ mbakke garbas ];
+    maintainers = with maintainers; [ mbakke garbas ma27 ];
     platforms = with platforms; unix;
   };
 }
diff --git a/pkgs/applications/misc/rofi/wrapper.nix b/pkgs/applications/misc/rofi/wrapper.nix
new file mode 100644
index 000000000000..44c6f892bf58
--- /dev/null
+++ b/pkgs/applications/misc/rofi/wrapper.nix
@@ -0,0 +1,17 @@
+{ stdenv, rofi-unwrapped, makeWrapper, theme ? null, lib }:
+
+stdenv.mkDerivation {
+  name = "rofi-${rofi-unwrapped.version}";
+  buildInputs = [ makeWrapper ];
+  preferLocalBuild = true;
+  passthru = { unwrapped = rofi-unwrapped; };
+  buildCommand = ''
+    mkdir -p $out/bin
+    ln -s ${rofi-unwrapped}/bin/rofi $out/bin/rofi
+    ${lib.optionalString (theme != null) ''wrapProgram $out/bin/rofi --add-flags "-theme ${theme}"''}
+  '';
+
+  meta = rofi-unwrapped.meta // {
+    priority = (rofi-unwrapped.meta.priority or 0) - 1;
+  };
+}