diff --git a/pkgs/shells/fish/plugins/clownfish.nix b/pkgs/shells/fish/plugins/clownfish.nix new file mode 100644 index 000000000000..cd5c997d3114 --- /dev/null +++ b/pkgs/shells/fish/plugins/clownfish.nix @@ -0,0 +1,20 @@ +{ lib, buildFishPlugin, fetchFromGitHub }: + +buildFishPlugin { + pname = "clownfish"; + version = "unstable-2021-01-17"; + + src = fetchFromGitHub { + owner = "IlanCosman"; + repo = "clownfish"; + rev = "a0db28d8280d05561b8f48c0465480725feeca4c"; + sha256 = "04xvikyrdm6yxh588vbpwvm04fas76pa7sigsaqrip7yh021xxab"; + }; + + meta = with lib; { + description = "Fish function to mock the behaviour of commands"; + homepage = "https://github.com/IlanCosman/clownfish"; + license = licenses.mit; + maintainers = with maintainers; [ pacien ]; + }; +} diff --git a/pkgs/shells/fish/plugins/default.nix b/pkgs/shells/fish/plugins/default.nix index e543d49516a8..50b8eb4d981e 100644 --- a/pkgs/shells/fish/plugins/default.nix +++ b/pkgs/shells/fish/plugins/default.nix @@ -4,10 +4,17 @@ lib.makeScope newScope (self: with self; { buildFishPlugin = callPackage ./build-fish-plugin.nix { }; + clownfish = callPackage ./clownfish.nix { }; + + # Fishtape 2.x and 3.x aren't compatible, + # but both versions are used in the tests of different other plugins. fishtape = callPackage ./fishtape.nix { }; + fishtape_3 = callPackage ./fishtape_3.nix { }; foreign-env = callPackage ./foreign-env { }; + fzf-fish = callPackage ./fzf-fish.nix { }; + pure = callPackage ./pure.nix { }; }) diff --git a/pkgs/shells/fish/plugins/fishtape_3.nix b/pkgs/shells/fish/plugins/fishtape_3.nix new file mode 100644 index 000000000000..893e6d65ffb3 --- /dev/null +++ b/pkgs/shells/fish/plugins/fishtape_3.nix @@ -0,0 +1,25 @@ +{ lib, buildFishPlugin, fetchFromGitHub }: + +buildFishPlugin rec { + pname = "fishtape"; + version = "3.0.1"; + + src = fetchFromGitHub { + owner = "jorgebucaran"; + repo = "fishtape"; + rev = version; + sha256 = "072a3qbk1lpxw53bxp91drsffylx8fbywhss3x0jbnayn9m8i7aa"; + }; + + checkFunctionDirs = [ "./functions" ]; # fishtape is introspective + checkPhase = '' + fishtape tests/*.fish + ''; + + meta = with lib; { + description = "100% pure-Fish test runner"; + homepage = "https://github.com/jorgebucaran/fishtape"; + license = licenses.mit; + maintainers = with maintainers; [ pacien ]; + }; +} diff --git a/pkgs/shells/fish/plugins/fzf-fish.nix b/pkgs/shells/fish/plugins/fzf-fish.nix new file mode 100644 index 000000000000..51e7dcc096b8 --- /dev/null +++ b/pkgs/shells/fish/plugins/fzf-fish.nix @@ -0,0 +1,34 @@ +{ lib, buildFishPlugin, fetchFromGitHub, fzf, clownfish, fishtape_3 }: + +buildFishPlugin rec { + pname = "fzf.fish"; + version = "5.6"; + + src = fetchFromGitHub { + owner = "PatrickF1"; + repo = "fzf.fish"; + rev = "v${version}"; + sha256 = "1b280n8bh00n4vkm19zrn84km52296ljlm1zhz95jgaiwymf2x73"; + }; + + checkInputs = [ fzf ]; + 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* + + # Disable tests that are failing, probably because of our wrappers + rm -r tests/search_shell_variables + + fishtape tests/*/*.fish + ''; + + meta = with lib; { + description = "Augment your fish command line with fzf key bindings"; + homepage = "https://github.com/PatrickF1/fzf.fish"; + license = licenses.mit; + maintainers = with maintainers; [ pacien ]; + }; +}