nixpkgs/pkgs/by-name/xp/xplr/package.nix
Pyrox 11255ef03c
maintainers: thehedgeh0g -> pyrox0
Also updates my information and contact info.

I no longer use The Hedgehog as my github username or online presence
username, so this fixes that. It also matches my github username, so it
should be easier for others to mention me if needed.
2024-04-24 12:53:58 -04:00

49 lines
1.4 KiB
Nix

{ lib, stdenv, rustPlatform, fetchFromGitHub }:
rustPlatform.buildRustPackage rec {
pname = "xplr";
version = "0.21.7";
src = fetchFromGitHub {
owner = "sayanarijit";
repo = pname;
rev = "v${version}";
sha256 = "sha256-ZitwO/XfNrlTFNepQ5Wyk1A7cwlNm6+26nPHdZ8Wh3c=";
};
cargoHash = "sha256-mfSVjm0s/tLjjygwu8TuKn92mFM3Ui6TEHkIzS0eEOA=";
# 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/applications
cp assets/desktop/xplr.desktop $out/share/applications
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";
mainProgram = "xplr";
homepage = "https://xplr.dev";
changelog = "https://github.com/sayanarijit/xplr/releases/tag/${src.rev}";
license = licenses.mit;
maintainers = with maintainers; [ sayanarijit suryasr007 pyrox0 mimame figsoda ];
};
}