From c197c5fb335ac49089f573e6e05865ba1cc107b8 Mon Sep 17 00:00:00 2001 From: Tom Hunze Date: Mon, 8 Sep 2025 18:39:54 +0200 Subject: [PATCH 1/2] bash-preexec: improve overridability --- pkgs/by-name/ba/bash-preexec/package.nix | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/ba/bash-preexec/package.nix b/pkgs/by-name/ba/bash-preexec/package.nix index 3eb7a82f4dfb..115cadf5658d 100644 --- a/pkgs/by-name/ba/bash-preexec/package.nix +++ b/pkgs/by-name/ba/bash-preexec/package.nix @@ -26,20 +26,28 @@ stdenvNoCC.mkDerivation { 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 = '' - install -Dm755 $src/bash-preexec.sh $out/share/bash/bash-preexec.sh + runHook preInstall + install -Dm755 bash-preexec.sh $out/share/bash/bash-preexec.sh + runHook postInstall ''; meta = with lib; { From d41b40c70081eab7eded6bf738af3b5374e2ba4a Mon Sep 17 00:00:00 2001 From: Tom Hunze Date: Mon, 8 Sep 2025 18:42:52 +0200 Subject: [PATCH 2/2] bash-preexec: refactor --- pkgs/by-name/ba/bash-preexec/package.nix | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/pkgs/by-name/ba/bash-preexec/package.nix b/pkgs/by-name/ba/bash-preexec/package.nix index 115cadf5658d..6ca0b8f337bc 100644 --- a/pkgs/by-name/ba/bash-preexec/package.nix +++ b/pkgs/by-name/ba/bash-preexec/package.nix @@ -15,8 +15,8 @@ stdenvNoCC.mkDerivation { src = fetchFromGitHub { owner = "rcaloras"; repo = "bash-preexec"; - rev = version; - sha256 = "sha256-4DzbeIiUX7iXy2CeSvRC2X+XnjVk+/UiMbM/dLHx7zU="; + tag = version; + hash = "sha256-4DzbeIiUX7iXy2CeSvRC2X+XnjVk+/UiMbM/dLHx7zU="; }; nativeCheckInputs = [ bats ]; @@ -50,14 +50,15 @@ stdenvNoCC.mkDerivation { runHook postInstall ''; - meta = with lib; { + meta = { description = "Preexec and precmd functions for Bash just like Zsh"; - license = licenses.mit; + license = lib.licenses.mit; homepage = "https://github.com/rcaloras/bash-preexec"; - maintainers = [ - maintainers.hawkw - maintainers.rycee + changelog = "https://github.com/rcaloras/bash-preexec/releases/tag/${version}"; + maintainers = with lib.maintainers; [ + hawkw + rycee ]; - platforms = platforms.unix; + platforms = lib.platforms.unix; }; }