summary refs log tree commit diff
path: root/pkgs/applications/misc/rofi/wrapper.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/applications/misc/rofi/wrapper.nix')
-rw-r--r--pkgs/applications/misc/rofi/wrapper.nix17
1 files changed, 17 insertions, 0 deletions
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;
+  };
+}