uboot: (firmwareOdroidC2/C4) don't invoke patch tool, use patches = [] instead
https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh#L948 this can do it nicely. Signed-off-by: Anton Arapov <anton@deadbeef.mx>
This commit is contained in:
commit
56de2bcd43
30691 changed files with 3076956 additions and 0 deletions
21
pkgs/shells/fish/babelfish.nix
Normal file
21
pkgs/shells/fish/babelfish.nix
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
{ lib, buildGoModule, fetchFromGitHub }:
|
||||
buildGoModule rec {
|
||||
pname = "babelfish";
|
||||
version = "1.1.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "bouk";
|
||||
repo = "babelfish";
|
||||
rev = "v${version}";
|
||||
sha256 = "0b1knj9llwzwnl4w3d6akvlc57dp0fszjkq98w8wybcvkbpd3ip1";
|
||||
};
|
||||
|
||||
vendorSha256 = "0kspqwbgiqfkfj9a9pdwzc0jdi9p35abqqqjhcpvqwdxw378w5lz";
|
||||
|
||||
meta = with lib; {
|
||||
description = "Translate bash scripts to fish";
|
||||
homepage = "https://github.com/bouk/babelfish";
|
||||
license = licenses.mit;
|
||||
maintainers = with maintainers; [ bouk kevingriffin ];
|
||||
};
|
||||
}
|
||||
342
pkgs/shells/fish/default.nix
Normal file
342
pkgs/shells/fish/default.nix
Normal file
|
|
@ -0,0 +1,342 @@
|
|||
{ stdenv
|
||||
, lib
|
||||
, fetchurl
|
||||
, fetchpatch
|
||||
, coreutils
|
||||
, which
|
||||
, gnused
|
||||
, gnugrep
|
||||
, groff
|
||||
, gawk
|
||||
, man-db
|
||||
, getent
|
||||
, libiconv
|
||||
, pcre2
|
||||
, gettext
|
||||
, ncurses
|
||||
, python3
|
||||
, cmake
|
||||
, fishPlugins
|
||||
, procps
|
||||
|
||||
# used to generate autocompletions from manpages and for configuration editing in the browser
|
||||
, usePython ? true
|
||||
|
||||
, runCommand
|
||||
, writeText
|
||||
, nixosTests
|
||||
, useOperatingSystemEtc ? true
|
||||
# An optional string containing Fish code that initializes the environment.
|
||||
# This is run at the very beginning of initialization. If it sets $NIX_PROFILES
|
||||
# then Fish will use that to configure its function, completion, and conf.d paths.
|
||||
# For example:
|
||||
# fishEnvPreInit = "source /etc/fish/my-env-preinit.fish";
|
||||
# It can also be a function that takes one argument, which is a function that
|
||||
# takes a path to a bash file and converts it to fish. For example:
|
||||
# fishEnvPreInit = source: source "${nix}/etc/profile.d/nix-daemon.sh";
|
||||
, fishEnvPreInit ? null
|
||||
}:
|
||||
let
|
||||
etcConfigAppendix = writeText "config.fish.appendix" ''
|
||||
############### ↓ Nix hook for sourcing /etc/fish/config.fish ↓ ###############
|
||||
# #
|
||||
# Origin:
|
||||
# This fish package was called with the attribute
|
||||
# "useOperatingSystemEtc = true;".
|
||||
#
|
||||
# Purpose:
|
||||
# Fish ordinarily sources /etc/fish/config.fish as
|
||||
# $__fish_sysconfdir/config.fish,
|
||||
# and $__fish_sysconfdir is defined at compile-time, baked into the C++
|
||||
# component of fish. By default, it is set to "/etc/fish". When building
|
||||
# through Nix, $__fish_sysconfdir gets set to $out/etc/fish. Here we may
|
||||
# have included a custom $out/etc/config.fish in the fish package,
|
||||
# as specified, but according to the value of useOperatingSystemEtc, we
|
||||
# may want to further source the real "/etc/fish/config.fish" file.
|
||||
#
|
||||
# When this option is enabled, this segment should appear the very end of
|
||||
# "$out/etc/config.fish". This is to emulate the behavior of fish itself
|
||||
# with respect to /etc/fish/config.fish and ~/.config/fish/config.fish:
|
||||
# source both, but source the more global configuration files earlier
|
||||
# than the more local ones, so that more local configurations inherit
|
||||
# from but override the more global locations.
|
||||
#
|
||||
# Special care needs to be taken, when fish is called from an FHS user env
|
||||
# or similar setup, because this configuration file will then be relocated
|
||||
# to /etc/fish/config.fish, so we test for this case to avoid nontermination.
|
||||
|
||||
if test -f /etc/fish/config.fish && test /etc/fish/config.fish != (status filename)
|
||||
source /etc/fish/config.fish
|
||||
end
|
||||
|
||||
# #
|
||||
############### ↑ Nix hook for sourcing /etc/fish/config.fish ↑ ###############
|
||||
'';
|
||||
|
||||
fishPreInitHooks = writeText "__fish_build_paths_suffix.fish" ''
|
||||
# source nixos environment
|
||||
# note that this is required:
|
||||
# 1. For all shells, not just login shells (mosh needs this as do some other command-line utilities)
|
||||
# 2. Before the shell is initialized, so that config snippets can find the commands they use on the PATH
|
||||
builtin status --is-login
|
||||
or test -z "$__fish_nixos_env_preinit_sourced" -a -z "$ETC_PROFILE_SOURCED" -a -z "$ETC_ZSHENV_SOURCED"
|
||||
${if fishEnvPreInit != null then ''
|
||||
and begin
|
||||
${lib.removeSuffix "\n" (if lib.isFunction fishEnvPreInit then fishEnvPreInit sourceWithFenv else fishEnvPreInit)}
|
||||
end'' else ''
|
||||
and test -f /etc/fish/nixos-env-preinit.fish
|
||||
and source /etc/fish/nixos-env-preinit.fish''}
|
||||
and set -gx __fish_nixos_env_preinit_sourced 1
|
||||
|
||||
test -n "$NIX_PROFILES"
|
||||
and begin
|
||||
# We ensure that __extra_* variables are read in $__fish_datadir/config.fish
|
||||
# with a preference for user-configured data by making sure the package-specific
|
||||
# data comes last. Files are loaded/sourced in encounter order, duplicate
|
||||
# basenames get skipped, so we assure this by prepending Nix profile paths
|
||||
# (ordered in reverse of the $NIX_PROFILE variable)
|
||||
#
|
||||
# Note that at this point in evaluation, there is nothing whatsoever on the
|
||||
# fish_function_path. That means we don't have most fish builtins, e.g., `eval`.
|
||||
|
||||
|
||||
# additional profiles are expected in order of precedence, which means the reverse of the
|
||||
# NIX_PROFILES variable (same as config.environment.profiles)
|
||||
set -l __nix_profile_paths (string split ' ' $NIX_PROFILES)[-1..1]
|
||||
|
||||
set -p __extra_completionsdir \
|
||||
$__nix_profile_paths"/etc/fish/completions" \
|
||||
$__nix_profile_paths"/share/fish/vendor_completions.d"
|
||||
set -p __extra_functionsdir \
|
||||
$__nix_profile_paths"/etc/fish/functions" \
|
||||
$__nix_profile_paths"/share/fish/vendor_functions.d"
|
||||
set -p __extra_confdir \
|
||||
$__nix_profile_paths"/etc/fish/conf.d" \
|
||||
$__nix_profile_paths"/share/fish/vendor_conf.d"
|
||||
end
|
||||
'';
|
||||
|
||||
# This is wrapped in begin/end in case the user wants to apply redirections.
|
||||
# This does mean the basic usage of sourcing a single file will produce
|
||||
# `begin; begin; …; end; end` but that's ok.
|
||||
sourceWithFenv = path: ''
|
||||
begin # fenv
|
||||
# This happens before $__fish_datadir/config.fish sets fish_function_path, so it is currently
|
||||
# unset. We set it and then completely erase it, leaving its configuration to $__fish_datadir/config.fish
|
||||
set fish_function_path ${fishPlugins.foreign-env}/share/fish/vendor_functions.d $__fish_datadir/functions
|
||||
fenv source ${lib.escapeShellArg path}
|
||||
set -l fenv_status $status
|
||||
# clear fish_function_path so that it will be correctly set when we return to $__fish_datadir/config.fish
|
||||
set -e fish_function_path
|
||||
test $fenv_status -eq 0
|
||||
end # fenv
|
||||
'';
|
||||
|
||||
fish = stdenv.mkDerivation rec {
|
||||
pname = "fish";
|
||||
version = "3.4.1";
|
||||
|
||||
src = fetchurl {
|
||||
# There are differences between the release tarball and the tarball GitHub
|
||||
# packages from the tag. Specifically, it comes with a file containing its
|
||||
# version, which is used in `build_tools/git_version_gen.sh` to determine
|
||||
# the shell's actual version (and what it displays when running `fish
|
||||
# --version`), as well as the local documentation for all builtins (and
|
||||
# maybe other things).
|
||||
url = "https://github.com/fish-shell/fish-shell/releases/download/${version}/${pname}-${version}.tar.xz";
|
||||
sha256 = "sha256-tvI7OEOwTbawqQ/qH28NDkDMAntKcyCYIAhj8oZKlOo=";
|
||||
};
|
||||
|
||||
patches = [
|
||||
# merged https://github.com/fish-shell/fish-shell/pull/8978
|
||||
# "create_manpage_completions.py: Do not overstrip commands with dots"
|
||||
(fetchpatch {
|
||||
name = "fix-cmdname-completeion-generator.patch";
|
||||
url = "https://github.com/fish-shell/fish-shell/commit/32d646a5483844e9b1fae4b73f252a34ec0d4c76.patch";
|
||||
sha256 = "sha256-51hqgPHQ7oQbl1i3SfqvGsbkYMe2Jh+sEwCRu2kiv1U=";
|
||||
})
|
||||
];
|
||||
|
||||
# Fix FHS paths in tests
|
||||
postPatch = ''
|
||||
# src/fish_tests.cpp
|
||||
sed -i 's|/bin/ls|${coreutils}/bin/ls|' src/fish_tests.cpp
|
||||
sed -i 's|is_potential_path(L"/usr"|is_potential_path(L"/nix"|' src/fish_tests.cpp
|
||||
sed -i 's|L"/bin/echo"|L"${coreutils}/bin/echo"|' src/fish_tests.cpp
|
||||
sed -i 's|L"/bin/c"|L"${coreutils}/bin/c"|' src/fish_tests.cpp
|
||||
sed -i 's|L"/bin/ca"|L"${coreutils}/bin/ca"|' src/fish_tests.cpp
|
||||
|
||||
# tests/checks/cd.fish
|
||||
sed -i 's|/bin/pwd|${coreutils}/bin/pwd|' tests/checks/cd.fish
|
||||
|
||||
# tests/checks/redirect.fish
|
||||
sed -i 's|/bin/echo|${coreutils}/bin/echo|' tests/checks/redirect.fish
|
||||
|
||||
# tests/checks/vars_as_commands.fish
|
||||
sed -i 's|/usr/bin|${coreutils}/bin|' tests/checks/vars_as_commands.fish
|
||||
|
||||
# tests/checks/jobs.fish
|
||||
sed -i 's|ps -o stat|${procps}/bin/ps -o stat|' tests/checks/jobs.fish
|
||||
sed -i 's|/bin/echo|${coreutils}/bin/echo|' tests/checks/jobs.fish
|
||||
|
||||
# tests/checks/job-control-noninteractive.fish
|
||||
sed -i 's|/bin/echo|${coreutils}/bin/echo|' tests/checks/job-control-noninteractive.fish
|
||||
|
||||
# tests/checks/complete.fish
|
||||
sed -i 's|/bin/ls|${coreutils}/bin/ls|' tests/checks/complete.fish
|
||||
'' + lib.optionalString stdenv.isDarwin ''
|
||||
# Tests use pkill/pgrep which are currently not built on Darwin
|
||||
# See https://github.com/NixOS/nixpkgs/pull/103180
|
||||
rm tests/pexpects/exit.py
|
||||
rm tests/pexpects/job_summary.py
|
||||
rm tests/pexpects/signals.py
|
||||
'' + lib.optionalString stdenv.isLinux ''
|
||||
# pexpect tests are flaky on aarch64-linux (also x86_64-linux)
|
||||
# See https://github.com/fish-shell/fish-shell/issues/8789
|
||||
rm tests/pexpects/exit_handlers.py
|
||||
'';
|
||||
|
||||
outputs = [ "out" "doc" ];
|
||||
strictDeps = true;
|
||||
nativeBuildInputs = [
|
||||
cmake
|
||||
gettext
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
ncurses
|
||||
libiconv
|
||||
pcre2
|
||||
];
|
||||
|
||||
cmakeFlags = [
|
||||
"-DCMAKE_INSTALL_DOCDIR=${placeholder "doc"}/share/doc/fish"
|
||||
] ++ lib.optionals stdenv.isDarwin [
|
||||
"-DMAC_CODESIGN_ID=OFF"
|
||||
];
|
||||
|
||||
# The optional string is kind of an inelegant way to get fish to cross compile.
|
||||
# Fish needs coreutils as a runtime dependency, and it gets put into
|
||||
# CMAKE_PREFIX_PATH, which cmake uses to look up build time programs, so it
|
||||
# was clobbering the PATH. It probably needs to be fixed at a lower level.
|
||||
preConfigure = ''
|
||||
patchShebangs ./build_tools/git_version_gen.sh
|
||||
'' + lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) ''
|
||||
export CMAKE_PREFIX_PATH=
|
||||
'';
|
||||
|
||||
# Required binaries during execution
|
||||
propagatedBuildInputs = [
|
||||
coreutils
|
||||
gnugrep
|
||||
gnused
|
||||
groff
|
||||
gettext
|
||||
] ++ lib.optional (!stdenv.isDarwin) man-db;
|
||||
|
||||
doCheck = true;
|
||||
|
||||
checkInputs = [
|
||||
coreutils
|
||||
(python3.withPackages (ps: [ ps.pexpect ]))
|
||||
procps
|
||||
];
|
||||
|
||||
checkPhase = ''
|
||||
make test
|
||||
'';
|
||||
|
||||
postInstall = with lib; ''
|
||||
sed -r "s|command grep|command ${gnugrep}/bin/grep|" \
|
||||
-i "$out/share/fish/functions/grep.fish"
|
||||
sed -e "s|\|cut|\|${coreutils}/bin/cut|" \
|
||||
-i "$out/share/fish/functions/fish_prompt.fish"
|
||||
sed -e "s|uname|${coreutils}/bin/uname|" \
|
||||
-i "$out/share/fish/functions/__fish_pwd.fish" \
|
||||
"$out/share/fish/functions/prompt_pwd.fish"
|
||||
sed -e "s|sed |${gnused}/bin/sed |" \
|
||||
-i "$out/share/fish/functions/alias.fish" \
|
||||
"$out/share/fish/functions/prompt_pwd.fish"
|
||||
sed -i "s|nroff|${groff}/bin/nroff|" \
|
||||
"$out/share/fish/functions/__fish_print_help.fish"
|
||||
sed -e "s|clear;|${getBin ncurses}/bin/clear;|" \
|
||||
-i "$out/share/fish/functions/fish_default_key_bindings.fish"
|
||||
sed -i "s|/usr/local/sbin /sbin /usr/sbin||" \
|
||||
$out/share/fish/completions/{sudo.fish,doas.fish}
|
||||
sed -e "s| awk | ${gawk}/bin/awk |" \
|
||||
-i $out/share/fish/functions/{__fish_print_packages.fish,__fish_print_addresses.fish,__fish_describe_command.fish,__fish_complete_man.fish,__fish_complete_convert_options.fish} \
|
||||
$out/share/fish/completions/{cwebp,adb,ezjail-admin,grunt,helm,heroku,lsusb,make,p4,psql,rmmod,vim-addons}.fish
|
||||
|
||||
'' + optionalString usePython ''
|
||||
cat > $out/share/fish/functions/__fish_anypython.fish <<EOF
|
||||
function __fish_anypython
|
||||
echo ${python3.interpreter}
|
||||
return 0
|
||||
end
|
||||
EOF
|
||||
|
||||
'' + optionalString stdenv.isLinux ''
|
||||
for cur in $out/share/fish/functions/*.fish; do
|
||||
sed -e "s|/usr/bin/getent|${getent}/bin/getent|" \
|
||||
-i "$cur"
|
||||
done
|
||||
|
||||
'' + optionalString (!stdenv.isDarwin) ''
|
||||
sed -i "s|Popen(\['manpath'|Popen(\['${man-db}/bin/manpath'|" \
|
||||
"$out/share/fish/tools/create_manpage_completions.py"
|
||||
sed -i "s|command manpath|command ${man-db}/bin/manpath|" \
|
||||
"$out/share/fish/functions/man.fish"
|
||||
'' + optionalString useOperatingSystemEtc ''
|
||||
tee -a $out/etc/fish/config.fish < ${etcConfigAppendix}
|
||||
'' + ''
|
||||
tee -a $out/share/fish/__fish_build_paths.fish < ${fishPreInitHooks}
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "Smart and user-friendly command line shell";
|
||||
homepage = "https://fishshell.com/";
|
||||
license = licenses.gpl2;
|
||||
platforms = platforms.unix;
|
||||
maintainers = with maintainers; [ cole-h ];
|
||||
};
|
||||
|
||||
passthru = {
|
||||
shellPath = "/bin/fish";
|
||||
tests = {
|
||||
nixos = nixosTests.fish;
|
||||
|
||||
# Test the fish_config tool by checking the generated splash page.
|
||||
# Since the webserver requires a port to run, it is not started.
|
||||
fishConfig =
|
||||
let fishScript = writeText "test.fish" ''
|
||||
set -x __fish_bin_dir ${fish}/bin
|
||||
echo $__fish_bin_dir
|
||||
cp -r ${fish}/share/fish/tools/web_config/* .
|
||||
chmod -R +w *
|
||||
|
||||
# if we don't set `delete=False`, the file will get cleaned up
|
||||
# automatically (leading the test to fail because there's no
|
||||
# tempfile to check)
|
||||
sed -e 's@, mode="w"@, mode="w", delete=False@' -i webconfig.py
|
||||
|
||||
# we delete everything after the fileurl is assigned
|
||||
sed -e '/fileurl =/q' -i webconfig.py
|
||||
echo "print(fileurl)" >> webconfig.py
|
||||
|
||||
# and check whether the message appears on the page
|
||||
cat (${python3}/bin/python ./webconfig.py \
|
||||
| tail -n1 | sed -ne 's|.*\(/build/.*\)|\1|p' \
|
||||
) | grep 'a href="http://localhost.*Start the Fish Web config'
|
||||
|
||||
# cannot test the http server because it needs a localhost port
|
||||
'';
|
||||
in
|
||||
runCommand "test-web-config" { } ''
|
||||
HOME=$(mktemp -d)
|
||||
${fish}/bin/fish ${fishScript} && touch $out
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
in
|
||||
fish
|
||||
64
pkgs/shells/fish/oh-my-fish/default.nix
Normal file
64
pkgs/shells/fish/oh-my-fish/default.nix
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
{ lib
|
||||
, stdenv
|
||||
, fetchFromGitHub
|
||||
, fish
|
||||
, bash
|
||||
, runtimeShell
|
||||
, writeShellScript
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "oh-my-fish";
|
||||
version = "7+unstable=2021-03-03";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = pname;
|
||||
repo = pname;
|
||||
rev = "0b1396ad7962073fa25615bf03c43b53eddc2d56";
|
||||
hash = "sha256-lwMo4+PcYR9kYJPWK+ALiMfBdxFSgB2vjtSn8QrmmEA=";
|
||||
};
|
||||
|
||||
strictDeps = true;
|
||||
buildInputs = [
|
||||
fish
|
||||
bash
|
||||
];
|
||||
|
||||
dontConfigure = true;
|
||||
dontBuild = true;
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
mkdir -pv $out/bin $out/share/${pname}
|
||||
cp -vr * $out/share/${pname}
|
||||
|
||||
cat << EOF > $out/bin/omf-install
|
||||
#!${runtimeShell}
|
||||
|
||||
${fish}/bin/fish \\
|
||||
$out/share/${pname}/bin/install \\
|
||||
--noninteractive \\
|
||||
--offline=$out/share/${pname}
|
||||
|
||||
EOF
|
||||
chmod +x $out/bin/omf-install
|
||||
|
||||
runHook PostInstall
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "https://github.com/oh-my-fish/oh-my-fish";
|
||||
description = "The Fish Shell Framework";
|
||||
longDescription = ''
|
||||
Oh My Fish provides core infrastructure to allow you to install packages
|
||||
which extend or modify the look of your shell. It's fast, extensible and
|
||||
easy to use.
|
||||
'';
|
||||
license = licenses.mit;
|
||||
maintainers = with maintainers; [ AndersonTorres ];
|
||||
mainProgram = "omf-install";
|
||||
platforms = fish.meta.platforms;
|
||||
};
|
||||
}
|
||||
# TODO: customize the omf-install script
|
||||
73
pkgs/shells/fish/plugins/build-fish-plugin.nix
Normal file
73
pkgs/shells/fish/plugins/build-fish-plugin.nix
Normal file
|
|
@ -0,0 +1,73 @@
|
|||
{ stdenv, lib, writeScript, wrapFish }:
|
||||
|
||||
attrs@{
|
||||
pname,
|
||||
version,
|
||||
src,
|
||||
|
||||
name ? "fishplugin-${pname}-${version}",
|
||||
unpackPhase ? "",
|
||||
configurePhase ? ":",
|
||||
buildPhase ? ":",
|
||||
preInstall ? "",
|
||||
postInstall ? "",
|
||||
|
||||
checkInputs ? [],
|
||||
# plugin packages to add to the vendor paths of the test fish shell
|
||||
checkPlugins ? [],
|
||||
# vendor directories to add to the function path of the test fish shell
|
||||
checkFunctionDirs ? [],
|
||||
# test script to be executed in a fish shell
|
||||
checkPhase ? "",
|
||||
doCheck ? checkPhase != "",
|
||||
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
# Do not pass attributes that are only relevant to buildFishPlugin to mkDerivation.
|
||||
drvAttrs = builtins.removeAttrs attrs [
|
||||
"checkPlugins"
|
||||
"checkFunctionDirs"
|
||||
];
|
||||
in
|
||||
|
||||
stdenv.mkDerivation (drvAttrs // {
|
||||
inherit name;
|
||||
inherit unpackPhase configurePhase buildPhase;
|
||||
|
||||
inherit preInstall postInstall;
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
(
|
||||
install_vendor_files() {
|
||||
source="$1"
|
||||
target="$out/share/fish/vendor_$2.d"
|
||||
|
||||
[ -d $source ] || return 0
|
||||
mkdir -p $target
|
||||
cp -r $source/*.fish "$target/"
|
||||
}
|
||||
|
||||
install_vendor_files completions completions
|
||||
install_vendor_files functions functions
|
||||
install_vendor_files conf conf
|
||||
install_vendor_files conf.d conf
|
||||
)
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
inherit doCheck;
|
||||
|
||||
checkInputs = [ (wrapFish {
|
||||
pluginPkgs = checkPlugins;
|
||||
functionDirs = checkFunctionDirs;
|
||||
}) ] ++ checkInputs;
|
||||
|
||||
checkPhase = ''
|
||||
export HOME=$(mktemp -d) # fish wants a writable home
|
||||
fish "${writeScript "${name}-test" checkPhase}"
|
||||
'';
|
||||
})
|
||||
20
pkgs/shells/fish/plugins/clownfish.nix
Normal file
20
pkgs/shells/fish/plugins/clownfish.nix
Normal file
|
|
@ -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 ];
|
||||
};
|
||||
}
|
||||
30
pkgs/shells/fish/plugins/default.nix
Normal file
30
pkgs/shells/fish/plugins/default.nix
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
{ lib, newScope }:
|
||||
|
||||
lib.makeScope newScope (self: with self; {
|
||||
|
||||
buildFishPlugin = callPackage ./build-fish-plugin.nix { };
|
||||
|
||||
clownfish = callPackage ./clownfish.nix { };
|
||||
|
||||
done = callPackage ./done.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 { };
|
||||
|
||||
forgit = callPackage ./forgit.nix { };
|
||||
|
||||
fzf-fish = callPackage ./fzf-fish.nix { };
|
||||
|
||||
grc = callPackage ./grc.nix { };
|
||||
|
||||
hydro = callPackage ./hydro.nix { };
|
||||
|
||||
pisces = callPackage ./pisces.nix { };
|
||||
|
||||
pure = callPackage ./pure.nix { };
|
||||
|
||||
})
|
||||
25
pkgs/shells/fish/plugins/done.nix
Normal file
25
pkgs/shells/fish/plugins/done.nix
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
{ lib, buildFishPlugin, fetchFromGitHub, fishtape }:
|
||||
|
||||
buildFishPlugin rec {
|
||||
pname = "done";
|
||||
version = "1.16.5";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "franciscolourenco";
|
||||
repo = "done";
|
||||
rev = version;
|
||||
sha256 = "E0wveeDw1VzEH2kzn63q9hy1xkccfxQHBV2gVpu2IdQ=";
|
||||
};
|
||||
|
||||
checkPlugins = [ fishtape ];
|
||||
checkPhase = ''
|
||||
fishtape test/done.fish
|
||||
'';
|
||||
|
||||
meta = {
|
||||
description = "Automatically receive notifications when long processes finish";
|
||||
homepage = "https://github.com/franciscolourenco/done";
|
||||
license = lib.licenses.mit;
|
||||
maintainers = with lib.maintainers; [ malo ];
|
||||
};
|
||||
}
|
||||
32
pkgs/shells/fish/plugins/fishtape.nix
Normal file
32
pkgs/shells/fish/plugins/fishtape.nix
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
{ lib, buildFishPlugin, fetchFromGitHub }:
|
||||
|
||||
buildFishPlugin rec {
|
||||
pname = "fishtape";
|
||||
version = "2.1.3";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "jorgebucaran";
|
||||
repo = "fishtape";
|
||||
rev = version;
|
||||
sha256 = "0dxcyhs2shhgy5xnwcimqja8vqsyk841x486lgq13i3y1h0kp2kd";
|
||||
};
|
||||
|
||||
checkFunctionDirs = [ "./" ]; # fishtape is introspective
|
||||
checkPhase = ''
|
||||
rm test/tty.fish # test expects a tty
|
||||
fishtape test/*.fish
|
||||
'';
|
||||
|
||||
preInstall = ''
|
||||
# move the function script in the proper sub-directory
|
||||
mkdir functions
|
||||
mv fishtape.fish functions/
|
||||
'';
|
||||
|
||||
meta = {
|
||||
description = "TAP-based test runner for Fish";
|
||||
homepage = "https://github.com/jorgebucaran/fishtape";
|
||||
license = lib.licenses.mit;
|
||||
maintainers = with lib.maintainers; [ pacien ];
|
||||
};
|
||||
}
|
||||
25
pkgs/shells/fish/plugins/fishtape_3.nix
Normal file
25
pkgs/shells/fish/plugins/fishtape_3.nix
Normal file
|
|
@ -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 ];
|
||||
};
|
||||
}
|
||||
29
pkgs/shells/fish/plugins/foreign-env/default.nix
Normal file
29
pkgs/shells/fish/plugins/foreign-env/default.nix
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
{ lib, buildFishPlugin, fetchFromGitHub, gnused, bash, coreutils }:
|
||||
|
||||
buildFishPlugin {
|
||||
pname = "foreign-env";
|
||||
version = "unstable-2020-02-09";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "oh-my-fish";
|
||||
repo = "plugin-foreign-env";
|
||||
rev = "dddd9213272a0ab848d474d0cbde12ad034e65bc";
|
||||
sha256 = "00xqlyl3lffc5l0viin1nyp819wf81fncqyz87jx8ljjdhilmgbs";
|
||||
};
|
||||
|
||||
patches = [ ./suppress-harmless-warnings.patch ];
|
||||
|
||||
preInstall = ''
|
||||
sed -e "s|sed|${gnused}/bin/sed|" \
|
||||
-e "s|bash|${bash}/bin/bash|" \
|
||||
-e "s|\| tr|\| ${coreutils}/bin/tr|" \
|
||||
-i functions/*
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "A foreign environment interface for Fish shell";
|
||||
license = licenses.mit;
|
||||
maintainers = with maintainers; [ jgillich ];
|
||||
platforms = with platforms; unix;
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
diff --git a/functions/fenv.apply.fish b/functions/fenv.apply.fish
|
||||
index 34a25e3..3d94135 100644
|
||||
--- a/functions/fenv.apply.fish
|
||||
+++ b/functions/fenv.apply.fish
|
||||
@@ -27,11 +27,17 @@ function fenv.apply
|
||||
for variable in $variables
|
||||
set key (echo $variable | sed 's/=.*//')
|
||||
set value (echo $variable | sed 's/[^=]*=//')
|
||||
+ set ignore PATH _
|
||||
|
||||
if test "$key" = 'PATH'
|
||||
set value (echo $value | tr ':' '\n')
|
||||
end
|
||||
|
||||
- set -g -x $key $value
|
||||
+ if contains $key $ignore
|
||||
+ set -g -x $key $value 2>/dev/null
|
||||
+ else
|
||||
+ set -g -x $key $value
|
||||
+ end
|
||||
+
|
||||
end
|
||||
end
|
||||
26
pkgs/shells/fish/plugins/forgit.nix
Normal file
26
pkgs/shells/fish/plugins/forgit.nix
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
{ lib, buildFishPlugin, fetchFromGitHub, git, fzf }:
|
||||
|
||||
buildFishPlugin rec {
|
||||
pname = "forgit";
|
||||
version = "unstable-2021-12-05";
|
||||
|
||||
preFixup = ''
|
||||
substituteInPlace $out/share/fish/vendor_conf.d/forgit.plugin.fish \
|
||||
--replace "fzf " "${fzf}/bin/fzf " \
|
||||
--replace "git " "${git}/bin/git "
|
||||
'';
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "wfxr";
|
||||
repo = "forgit";
|
||||
rev = "7b26cd46ac768af51b8dd4b84b6567c4e1c19642";
|
||||
sha256 = "sha256-S/alL3CiyedJ8aGhC2Vg9fmLJYcLxDe4EjQns5dZkKM=";
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
description = "A utility tool powered by fzf for using git interactively.";
|
||||
homepage = "https://github.com/wfxr/forgit";
|
||||
license = licenses.mit;
|
||||
maintainers = with maintainers; [ happysalada ];
|
||||
};
|
||||
}
|
||||
40
pkgs/shells/fish/plugins/fzf-fish.nix
Normal file
40
pkgs/shells/fish/plugins/fzf-fish.nix
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
{ lib, stdenv, buildFishPlugin, fetchFromGitHub, fd, fzf, util-linux, clownfish, fishtape_3 }:
|
||||
|
||||
buildFishPlugin rec {
|
||||
pname = "fzf.fish";
|
||||
version = "8.3";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "PatrickF1";
|
||||
repo = "fzf.fish";
|
||||
rev = "v${version}";
|
||||
sha256 = "sha256-eSNUqvKXTxcuvICxo8BmVWL1ESXQuU7VhOl7aONrhwM=";
|
||||
};
|
||||
|
||||
checkInputs = [ fzf fd util-linux ];
|
||||
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/configure_bindings
|
||||
rm -r tests/search_shell_variables
|
||||
|
||||
# Disable tests that are failing, because there is not 'rev' command
|
||||
rm tests/preview_file/custom_file_preview.fish
|
||||
|
||||
'' + (
|
||||
if stdenv.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";
|
||||
license = licenses.mit;
|
||||
maintainers = with maintainers; [ pacien ];
|
||||
};
|
||||
}
|
||||
20
pkgs/shells/fish/plugins/grc.nix
Normal file
20
pkgs/shells/fish/plugins/grc.nix
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
{ lib, buildFishPlugin, fetchFromGitHub }:
|
||||
|
||||
buildFishPlugin {
|
||||
pname = "grc";
|
||||
version = "unstable-2022-05-24";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "oh-my-fish";
|
||||
repo = "plugin-grc";
|
||||
rev = "61de7a8a0d7bda3234f8703d6e07c671992eb079";
|
||||
sha256 = "sha256-NQa12L0zlEz2EJjMDhWUhw5cz/zcFokjuCK5ZofTn+Q=";
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
description = "grc Colourizer for some commands on Fish shell";
|
||||
license = licenses.mit;
|
||||
maintainers = with maintainers; [ onny ];
|
||||
platforms = with platforms; unix;
|
||||
};
|
||||
}
|
||||
20
pkgs/shells/fish/plugins/hydro.nix
Normal file
20
pkgs/shells/fish/plugins/hydro.nix
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
{ lib, buildFishPlugin, fetchFromGitHub }:
|
||||
|
||||
buildFishPlugin rec {
|
||||
pname = "hydro";
|
||||
version = "unstable-2022-02-21";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "jorgebucaran";
|
||||
repo = "hydro";
|
||||
rev = "d4875065ceea226f58ead97dd9b2417937344d6e";
|
||||
sha256 = "sha256-nXeDnqqOuZyrqGTPEQtYlFvrFvy1bZVMF4CA37b0lsE=";
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
description = "Ultra-pure, lag-free prompt with async Git status";
|
||||
homepage = "https://github.com/jorgebucaran/hydro";
|
||||
license = licenses.mit;
|
||||
maintainers = with maintainers; [ mrhedgehog ];
|
||||
};
|
||||
}
|
||||
20
pkgs/shells/fish/plugins/pisces.nix
Normal file
20
pkgs/shells/fish/plugins/pisces.nix
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
{ lib, buildFishPlugin, fetchFromGitHub }:
|
||||
|
||||
buildFishPlugin rec {
|
||||
pname = "pisces";
|
||||
version = "0.7.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "laughedelic";
|
||||
repo = pname;
|
||||
rev = "v${version}";
|
||||
sha256 = "sha256-Oou2IeNNAqR00ZT3bss/DbhrJjGeMsn9dBBYhgdafBw=";
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
description = "Paired symbols in the command line";
|
||||
homepage = "https://github.com/laughedelic/pisces";
|
||||
license = licenses.lgpl3;
|
||||
maintainers = with maintainers; [ vanilla ];
|
||||
};
|
||||
}
|
||||
37
pkgs/shells/fish/plugins/pure.nix
Normal file
37
pkgs/shells/fish/plugins/pure.nix
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
{ lib, buildFishPlugin, fetchFromGitHub, git, fishtape }:
|
||||
|
||||
buildFishPlugin rec {
|
||||
pname = "pure";
|
||||
version = "4.1.1";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "pure-fish";
|
||||
repo = "pure";
|
||||
rev = "v${version}";
|
||||
sha256 = "1x1h65l8582p7h7w5986sc9vfd7b88a7hsi68dbikm090gz8nlxx";
|
||||
};
|
||||
|
||||
# The tests aren't passing either on the project's CI.
|
||||
# The release notes of the program for v3.5.0 say:
|
||||
# > Tests are going crazy at the moment, should be fixed once fishtape 3.0
|
||||
# > is released, and we do the switch.
|
||||
# This is tracked in https://github.com/pure-fish/pure/issues/272
|
||||
# and https://github.com/pure-fish/pure/pull/275.
|
||||
doCheck = false;
|
||||
|
||||
checkInputs = [ git ];
|
||||
checkPlugins = [ fishtape ];
|
||||
checkPhase = ''
|
||||
# https://github.com/rafaelrinaldi/pure/issues/264
|
||||
rm tests/_pure_string_width.test.fish
|
||||
|
||||
fishtape tests/*.test.fish
|
||||
'';
|
||||
|
||||
meta = {
|
||||
description = "Pretty, minimal and fast Fish prompt, ported from zsh";
|
||||
homepage = "https://github.com/rafaelrinaldi/pure";
|
||||
license = lib.licenses.mit;
|
||||
maintainers = with lib.maintainers; [ pacien ];
|
||||
};
|
||||
}
|
||||
25
pkgs/shells/fish/wrapper.nix
Normal file
25
pkgs/shells/fish/wrapper.nix
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
{ lib, writeShellScriptBin, fish }:
|
||||
|
||||
with lib;
|
||||
|
||||
makeOverridable ({
|
||||
completionDirs ? [],
|
||||
functionDirs ? [],
|
||||
confDirs ? [],
|
||||
pluginPkgs ? []
|
||||
}:
|
||||
|
||||
let
|
||||
vendorDir = kind: plugin: "${plugin}/share/fish/vendor_${kind}.d";
|
||||
complPath = completionDirs ++ map (vendorDir "completions") pluginPkgs;
|
||||
funcPath = functionDirs ++ map (vendorDir "functions") pluginPkgs;
|
||||
confPath = confDirs ++ map (vendorDir "conf") pluginPkgs;
|
||||
|
||||
in writeShellScriptBin "fish" ''
|
||||
${fish}/bin/fish --init-command "
|
||||
set --prepend fish_complete_path ${escapeShellArgs complPath}
|
||||
set --prepend fish_function_path ${escapeShellArgs funcPath}
|
||||
set --local fish_conf_source_path ${escapeShellArgs confPath}
|
||||
for c in \$fish_conf_source_path/*; source \$c; end
|
||||
" "$@"
|
||||
'')
|
||||
Loading…
Add table
Add a link
Reference in a new issue