Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 711637a4a7b4
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 4e44b638929b
Choose a head ref
  • 2 commits
  • 1 file changed
  • 2 contributors

Commits on Jun 20, 2017

  1. ranger: add imagePreviewSupport option and make previews work out of …

    …the box
    
    Before one had to turn it on manually and update the preview script in dotfiles
    manually when ranger updates.
    
    Now it requires zero configuration. Just run `ranger` and it works, and
    should continue to work automagically when ranger updates.
    
    Everything still can be (de)configured via `rc.conf` in dotfiles.
    oxij committed Jun 20, 2017

    Verified

    This commit was signed with the committer’s verified signature.
    jtojnar Jan Tojnar
    Copy the full SHA
    08ba40a View commit details

Commits on Jun 27, 2017

  1. Merge pull request #26453 from oxij/pkg/fix/ranger

    ranger: add imagePreviewSupport option and make previews work out of the box
    joachifm authored Jun 27, 2017
    Copy the full SHA
    4e44b63 View commit details
Showing with 17 additions and 3 deletions.
  1. +17 −3 pkgs/applications/misc/ranger/default.nix
20 changes: 17 additions & 3 deletions pkgs/applications/misc/ranger/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
{ stdenv, fetchurl, pythonPackages, w3m, file, less }:
{ stdenv, fetchurl, pythonPackages, file, less
, imagePreviewSupport ? true, w3m ? null}:

with stdenv.lib;

assert imagePreviewSupport -> w3m != null;

pythonPackages.buildPythonApplication rec {
name = "ranger-1.8.1";
@@ -23,14 +28,23 @@ pythonPackages.buildPythonApplication rec {
'';

preConfigure = ''
substituteInPlace ranger/ext/img_display.py \
--replace /usr/lib/w3m ${w3m}/libexec/w3m
substituteInPlace ranger/__init__.py \
--replace "DEFAULT_PAGER = 'less'" "DEFAULT_PAGER = '${stdenv.lib.getBin less}/bin/less'"
for i in ranger/config/rc.conf doc/config/rc.conf ; do
substituteInPlace $i --replace /usr/share $out/share
done
# 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"
'' + optionalString imagePreviewSupport ''
substituteInPlace ranger/ext/img_display.py \
--replace /usr/lib/w3m ${w3m}/libexec/w3m
# give image previews out of the box when building with w3m
substituteInPlace ranger/config/rc.conf \
--replace "set preview_images false" "set preview_images true" \
'';

}