about summary refs log tree commit diff
path: root/pkgs/applications/file-managers
diff options
context:
space:
mode:
authorAndersonTorres <torres.anderson.85@protonmail.com>2022-06-26 23:34:33 -0300
committerAndersonTorres <torres.anderson.85@protonmail.com>2022-06-26 23:58:13 -0300
commit25bc8d2b18f960921ea3b5eabb6eb89510c1742e (patch)
tree35445ed6208a3e45ace5e5bfb61e6bc134b64875 /pkgs/applications/file-managers
parentd2c526c2e6a866f62245f54e9522893d62ed9966 (diff)
vifm: move to applications/file-managers
Diffstat (limited to 'pkgs/applications/file-managers')
-rw-r--r--pkgs/applications/file-managers/vifm/default.nix43
1 files changed, 43 insertions, 0 deletions
diff --git a/pkgs/applications/file-managers/vifm/default.nix b/pkgs/applications/file-managers/vifm/default.nix
new file mode 100644
index 0000000000000..e3f2e80c47a5f
--- /dev/null
+++ b/pkgs/applications/file-managers/vifm/default.nix
@@ -0,0 +1,43 @@
+{ stdenv, fetchurl, makeWrapper
+, pkg-config
+, 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.12";
+
+  src = fetchurl {
+    url = "https://github.com/vifm/vifm/releases/download/v${version}/vifm-${version}.tar.bz2";
+    sha256 = "1h5j4y704nciyzg3aaav8sl3r5h9mpwq8f28cj65nnxk6a7n3a9k";
+  };
+
+  nativeBuildInputs = [ pkg-config 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/";
+    changelog = "https://github.com/vifm/vifm/blob/v${version}/ChangeLog";
+  };
+}