nixpkgs/pkgs/shells/fish/plugins/fzf-fish.nix
Artturin e0464e4788 treewide: replace stdenv.is with stdenv.hostPlatform.is
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"
```
2024-09-25 00:04:37 +03:00

46 lines
1.6 KiB
Nix

{ lib, stdenv, pkgs, buildFishPlugin, fetchFromGitHub, fd, unixtools, procps, clownfish, fishtape_3, }:
let
# we want `pkgs.fzf`, not `fishPlugins.fzf`
inherit (pkgs) fzf;
in
buildFishPlugin rec {
pname = "fzf.fish";
version = "10.3";
src = fetchFromGitHub {
owner = "PatrickF1";
repo = "fzf.fish";
rev = "v${version}";
hash = "sha256-T8KYLA/r/gOKvAivKRoeqIwE2pINlxFQtZJHpOy9GMM=";
};
nativeCheckInputs = [ fzf fd unixtools.script procps ];
checkPlugins = [ clownfish fishtape_3 ];
checkFunctionDirs = [ "./functions" ];
checkPhase = ''
# Disable git tests which inspect the project's git repo, which isn't
# possible since we strip the impure .git from our build input
rm -r tests/*git*
rm -r tests/preview_changed_file/modified_path_with_spaces.fish
rm -r tests/preview_changed_file/renamed_path_modifications.fish
# Disable tests that are failing, probably because of our wrappers
rm -r tests/configure_bindings
rm -r tests/search_variables
# Disable tests that are failing, because there is not 'rev' command
rm tests/preview_file/custom_file_preview.fish
'' + (
if stdenv.hostPlatform.isDarwin then ''script /dev/null fish -c "fishtape tests/*/*.fish"''
else ''script -c 'fish -c "fishtape tests/*/*.fish"' ''
);
meta = with lib; {
description = "Augment your fish command line with fzf key bindings";
homepage = "https://github.com/PatrickF1/fzf.fish";
changelog = "https://github.com/PatrickF1/fzf.fish/releases/tag/${src.rev}";
license = licenses.mit;
maintainers = with maintainers; [ pacien natsukium ];
};
}