Files
nixpkgs/pkgs/by-name/ba/bash-preexec/package.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

65 lines
1.3 KiB
Nix

{
stdenvNoCC,
lib,
fetchFromGitHub,
bats,
}:
let
version = "0.6.0";
in
stdenvNoCC.mkDerivation {
pname = "bash-preexec";
inherit version;
src = fetchFromGitHub {
owner = "rcaloras";
repo = "bash-preexec";
tag = version;
hash = "sha256-4DzbeIiUX7iXy2CeSvRC2X+XnjVk+/UiMbM/dLHx7zU=";
};
nativeCheckInputs = [ bats ];
dontConfigure = true;
doCheck = true;
dontBuild = true;
patchPhase = ''
runHook prePatch
# Needed since the tests expect that HISTCONTROL is set.
sed -i '/setup()/a HISTCONTROL=""' test/bash-preexec.bats
# Skip tests failing with Bats 1.5.0.
# See https://github.com/rcaloras/bash-preexec/issues/121
sed -i '/^@test.*IFS/,/^}/d' test/bash-preexec.bats
runHook postPatch
'';
checkPhase = ''
runHook preCheck
bats test
runHook postCheck
'';
installPhase = ''
runHook preInstall
install -Dm755 bash-preexec.sh $out/share/bash/bash-preexec.sh
runHook postInstall
'';
meta = {
description = "Preexec and precmd functions for Bash just like Zsh";
license = lib.licenses.mit;
homepage = "https://github.com/rcaloras/bash-preexec";
changelog = "https://github.com/rcaloras/bash-preexec/releases/tag/${version}";
maintainers = with lib.maintainers; [
hawkw
rycee
];
platforms = lib.platforms.unix;
};
}