about summary refs log tree commit diff
path: root/pkgs/by-name/xp/xplr/package.nix
diff options
context:
space:
mode:
authorAnomalocaridid <29845794+Anomalocaridid@users.noreply.github.com>2023-12-26 16:03:47 -0500
committerAnomalocaridid <29845794+Anomalocaridid@users.noreply.github.com>2023-12-26 16:03:47 -0500
commitcbf97b88b5224c04e0e721791c1a1e560dfe0fad (patch)
treeacce22f0f7580c449ea7d13d5025fd87f6f82b87 /pkgs/by-name/xp/xplr/package.nix
parente4c637d0f142a95f8d9d139e40ed5193d42d4ea0 (diff)
downloadnixlib-cbf97b88b5224c04e0e721791c1a1e560dfe0fad.tar
nixlib-cbf97b88b5224c04e0e721791c1a1e560dfe0fad.tar.gz
nixlib-cbf97b88b5224c04e0e721791c1a1e560dfe0fad.tar.bz2
nixlib-cbf97b88b5224c04e0e721791c1a1e560dfe0fad.tar.lz
nixlib-cbf97b88b5224c04e0e721791c1a1e560dfe0fad.tar.xz
nixlib-cbf97b88b5224c04e0e721791c1a1e560dfe0fad.tar.zst
nixlib-cbf97b88b5224c04e0e721791c1a1e560dfe0fad.zip
xplr: migrate to pkgs/by-name
Diffstat (limited to 'pkgs/by-name/xp/xplr/package.nix')
-rw-r--r--pkgs/by-name/xp/xplr/package.nix47
1 files changed, 47 insertions, 0 deletions
diff --git a/pkgs/by-name/xp/xplr/package.nix b/pkgs/by-name/xp/xplr/package.nix
new file mode 100644
index 000000000000..b16c59503848
--- /dev/null
+++ b/pkgs/by-name/xp/xplr/package.nix
@@ -0,0 +1,47 @@
+{ lib, stdenv, rustPlatform, fetchFromGitHub }:
+
+rustPlatform.buildRustPackage rec {
+  pname = "xplr";
+  version = "0.21.3";
+
+  src = fetchFromGitHub {
+    owner = "sayanarijit";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "sha256-lqFhLCOLiuSQWhbcZUEj2xFRlZ+x1ZTVc8IJw7tJjhE=";
+  };
+
+  cargoHash = "sha256-3hrpg2cMvIuFy6mH1/1igIpU4nbzFQLCAhiIRZbTuaI=";
+
+  # fixes `thread 'main' panicked at 'cannot find strip'` on x86_64-darwin
+  env = lib.optionalAttrs (stdenv.isx86_64 && stdenv.isDarwin) {
+    TARGET_STRIP = "${stdenv.cc.targetPrefix}strip";
+  };
+
+  # error: linker `aarch64-linux-gnu-gcc` not found
+  postPatch = ''
+    rm .cargo/config
+  '';
+
+  postInstall = ''
+    mkdir -p $out/share
+    cp assets/desktop/xplr.desktop $out/share
+
+    mkdir -p $out/share/icons/hicolor/scalable/apps
+    cp assets/icon/xplr.svg $out/share/icons/hicolor/scalable/apps
+
+    for size in 16 32 64 128; do
+      icon_dir=$out/share/icons/hicolor/''${size}x$size/apps
+      mkdir -p $icon_dir
+      cp assets/icon/xplr$size.png $icon_dir/xplr.png
+    done
+  '';
+
+  meta = with lib; {
+    description = "A hackable, minimal, fast TUI file explorer";
+    homepage = "https://xplr.dev";
+    changelog = "https://github.com/sayanarijit/xplr/releases/tag/${src.rev}";
+    license = licenses.mit;
+    maintainers = with maintainers; [ sayanarijit suryasr007 thehedgeh0g mimame figsoda ];
+  };
+}