summary refs log tree commit diff
path: root/pkgs/applications
diff options
context:
space:
mode:
authorxeji <36407913+xeji@users.noreply.github.com>2018-09-28 20:24:29 +0200
committerGitHub <noreply@github.com>2018-09-28 20:24:29 +0200
commite72de0870c71568c5dc4f6456370cba62b360275 (patch)
tree83e639f292904966a419e881275bf3512a825a49 /pkgs/applications
parent5b39fd6ce6605a72a75b0f0e4b30be94eeeed0fb (diff)
parentd152089772b31417cd243c73fb5d5878d7512f7a (diff)
downloadnixlib-e72de0870c71568c5dc4f6456370cba62b360275.tar
nixlib-e72de0870c71568c5dc4f6456370cba62b360275.tar.gz
nixlib-e72de0870c71568c5dc4f6456370cba62b360275.tar.bz2
nixlib-e72de0870c71568c5dc4f6456370cba62b360275.tar.lz
nixlib-e72de0870c71568c5dc4f6456370cba62b360275.tar.xz
nixlib-e72de0870c71568c5dc4f6456370cba62b360275.tar.zst
nixlib-e72de0870c71568c5dc4f6456370cba62b360275.zip
Merge pull request #47432 from alyssais/ranger
ranger: syntax highlight previews by default
Diffstat (limited to 'pkgs/applications')
-rw-r--r--pkgs/applications/misc/ranger/default.nix11
1 files changed, 8 insertions, 3 deletions
diff --git a/pkgs/applications/misc/ranger/default.nix b/pkgs/applications/misc/ranger/default.nix
index 6d883d89de31..5417a135dda4 100644
--- a/pkgs/applications/misc/ranger/default.nix
+++ b/pkgs/applications/misc/ranger/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, python3Packages, file, less
+{ stdenv, lib, fetchFromGitHub, python3Packages, file, less, highlight
 , imagePreviewSupport ? true, w3m ? null}:
 
 with stdenv.lib;
@@ -24,6 +24,11 @@ python3Packages.buildPythonApplication rec {
   '';
 
   preConfigure = ''
+    ${lib.optionalString (highlight != null) ''
+      sed -i -e 's|^\s*highlight\b|${highlight}/bin/highlight|' \
+        ranger/data/scope.sh
+    ''}
+
     substituteInPlace ranger/data/scope.sh \
       --replace "/bin/echo" "echo"
 
@@ -36,7 +41,7 @@ python3Packages.buildPythonApplication rec {
 
     # give file previews out of the box
     substituteInPlace ranger/config/rc.conf \
-      --replace "set preview_script ~/.config/ranger/scope.sh" "set preview_script $out/share/doc/ranger/config/scope.sh"
+      --replace "#set preview_script ~/.config/ranger/scope.sh" "set preview_script $out/share/doc/ranger/config/scope.sh"
   '' + optionalString imagePreviewSupport ''
     substituteInPlace ranger/ext/img_display.py \
       --replace /usr/lib/w3m ${w3m}/libexec/w3m
@@ -46,7 +51,7 @@ python3Packages.buildPythonApplication rec {
       --replace "set preview_images false" "set preview_images true"
   '';
 
-  meta =  with stdenv.lib; {
+  meta =  with lib; {
     description = "File manager with minimalistic curses interface";
     homepage = http://ranger.github.io/;
     license = licenses.gpl3;