@@ -1,11 +1,15 @@
1−{ stdenv, fetchurl
1+{ stdenv, fetchurl, makeWrapper
22, pkgconfig
33, ncurses, libX11
44, utillinux, file, which, groff
5+
6+ # adds support for handling removable media (vifm-media). Linux only!
7+, mediaSupport ? false, python3 ? null, udisks2 ? null, lib ? null
58}:
69
7−stdenv.mkDerivation rec {
8− pname = "vifm";
10+let isFullPackage = mediaSupport;
11+in stdenv.mkDerivation rec {
12+ pname = if isFullPackage then "vifm-full" else "vifm";
913 version = "0.10.1";
1014
1115 src = fetchurl {
@@ -13,13 +17,24 @@ stdenv.mkDerivation rec {
1317 sha256 = "0fyhxh7ndjn8fyjhj14ymkr3pjcs3k1xbs43g7xvvq85vdb6y04r";
1418 };
1519
16− nativeBuildInputs = [ pkgconfig ];
20+ nativeBuildInputs = [ pkgconfig makeWrapper ];
1721 buildInputs = [ ncurses libX11 utillinux file which groff ];
1822
23+ postFixup = let
24+ path = lib.makeBinPath
25+ [ udisks2
26+ (python3.withPackages (p: [p.dbus-python]))
27+ ];
28+
29+ wrapVifmMedia = "wrapProgram $out/share/vifm/vifm-media --prefix PATH : ${path}";
30+ in ''
31+ ${if mediaSupport then wrapVifmMedia else ""}
32+ '';
33+
1934 meta = with stdenv.lib; {
20− description = "A vi-like file manager";
35+ description = ''A vi-like file manager${if isFullPackage then "; Includes support for optional features" else ""}'';
2136 maintainers = with maintainers; [ raskin ];
22− platforms = platforms.unix;
37+ platforms = if mediaSupport then platforms.linux else platforms.unix;
2338 license = licenses.gpl2;
2439 downloadPage = "https://vifm.info/downloads.shtml";
2540 homepage = https://vifm.info/;