nixpkgs/pkgs/applications/misc/vifm/default.nix
Profpatsch 4a7f99d55d treewide: with stdenv.lib; in meta -> with lib;
Part of: https://github.com/NixOS/nixpkgs/issues/108938

meta = with stdenv.lib;

is a widely used pattern. We want to slowly remove
the `stdenv.lib` indirection and encourage people
to use `lib` directly. Thus let’s start with the meta
field.

This used a rewriting script to mostly automatically
replace all occurances of this pattern, and add the
`lib` argument to the package header if it doesn’t
exist yet.

The script in its current form is available at
https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
2021-01-11 10:38:22 +01:00

45 lines
1.4 KiB
Nix

{ stdenv, fetchurl, makeWrapper
, pkgconfig
, ncurses, libX11
, util-linux, file, which, groff
# adds support for handling removable media (vifm-media). Linux only!
, mediaSupport ? false, python3 ? null, udisks2 ? null, lib ? null
}:
let isFullPackage = mediaSupport;
in stdenv.mkDerivation rec {
pname = if isFullPackage then "vifm-full" else "vifm";
version = "0.11";
src = fetchurl {
url = "https://github.com/vifm/vifm/releases/download/v${version}/vifm-${version}.tar.bz2";
sha256 = "0rqyd424y0g5b5basw2ybb60r9gar4f40d1xgzr3c2dsy4jpwvyh";
};
nativeBuildInputs = [ pkgconfig makeWrapper ];
buildInputs = [ ncurses libX11 util-linux file which groff ];
postFixup = let
path = lib.makeBinPath
[ udisks2
(python3.withPackages (p: [p.dbus-python]))
];
wrapVifmMedia = "wrapProgram $out/share/vifm/vifm-media --prefix PATH : ${path}";
in ''
${if mediaSupport then wrapVifmMedia else ""}
'';
meta = with lib; {
description = ''A vi-like file manager${if isFullPackage then "; Includes support for optional features" else ""}'';
maintainers = with maintainers; [ raskin ];
platforms = if mediaSupport then platforms.linux else platforms.unix;
license = licenses.gpl2;
downloadPage = "https://vifm.info/downloads.shtml";
homepage = "https://vifm.info/";
inherit version;
updateWalker = true;
};
}