mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-21 20:34:06 +00:00
e0464e4788
In preparation for the deprecation of `stdenv.isX`. These shorthands are not conducive to cross-compilation because they hide the platforms. Darwin might get cross-compilation for which the continued usage of `stdenv.isDarwin` will get in the way One example of why this is bad and especially affects compiler packages https://www.github.com/NixOS/nixpkgs/pull/343059 There are too many files to go through manually but a treewide should get users thinking when they see a `hostPlatform.isX` in a place where it doesn't make sense. ``` fd --type f "\.nix" | xargs sd --fixed-strings "stdenv.is" "stdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "stdenv'.is" "stdenv'.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "clangStdenv.is" "clangStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "gccStdenv.is" "gccStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "stdenvNoCC.is" "stdenvNoCC.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "inherit (stdenv) is" "inherit (stdenv.hostPlatform) is" fd --type f "\.nix" | xargs sd --fixed-strings "buildStdenv.is" "buildStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "effectiveStdenv.is" "effectiveStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "originalStdenv.is" "originalStdenv.hostPlatform.is" ```
58 lines
1.4 KiB
Nix
58 lines
1.4 KiB
Nix
{
|
|
rustPlatform,
|
|
fetchFromGitHub,
|
|
lib,
|
|
|
|
installShellFiles,
|
|
stdenv,
|
|
Foundation,
|
|
rust-jemalloc-sys,
|
|
}:
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
pname = "yazi";
|
|
version = "0.3.3";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "sxyazi";
|
|
repo = "yazi";
|
|
rev = "v${version}";
|
|
hash = "sha256-bTDf8muJN0G4+c6UagtWgNLlmGN15twEBjdmKEP0bCE=";
|
|
};
|
|
|
|
cargoHash = "sha256-8UsdanF8y4uFoXdC7aAw7pVFRd9GACcfVvqkUtFmN5k=";
|
|
|
|
env.YAZI_GEN_COMPLETIONS = true;
|
|
env.VERGEN_GIT_SHA = "Nixpkgs";
|
|
env.VERGEN_BUILD_DATE = "2024-09-04";
|
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
buildInputs = [ rust-jemalloc-sys ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ Foundation ];
|
|
|
|
postInstall = ''
|
|
installShellCompletion --cmd yazi \
|
|
--bash ./yazi-boot/completions/yazi.bash \
|
|
--fish ./yazi-boot/completions/yazi.fish \
|
|
--zsh ./yazi-boot/completions/_yazi
|
|
|
|
install -Dm444 assets/yazi.desktop -t $out/share/applications
|
|
install -Dm444 assets/logo.png $out/share/pixmaps/yazi.png
|
|
'';
|
|
|
|
passthru.updateScript.command = [ ./update.sh ];
|
|
|
|
meta = {
|
|
description = "Blazing fast terminal file manager written in Rust, based on async I/O";
|
|
homepage = "https://github.com/sxyazi/yazi";
|
|
license = lib.licenses.mit;
|
|
maintainers = with lib.maintainers; [
|
|
xyenon
|
|
matthiasbeyer
|
|
linsui
|
|
eljamm
|
|
uncenter
|
|
];
|
|
mainProgram = "yazi";
|
|
};
|
|
}
|