nixpkgs/pkgs/build-support/setup-hooks/patch-rc-path-hooks/default.nix
2026-05-25 13:48:20 +02:00

61 lines
1.6 KiB
Nix

{
lib,
callPackage,
makeSetupHook,
gnused,
}:
let
tests = import ./test { inherit callPackage; };
in
{
patchRcPathBash = makeSetupHook {
name = "patch-rc-path-bash";
meta = {
description = "Setup-hook to inject source-time PATH prefix to a Bash/Ksh/Zsh script";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ ShamrockLee ];
};
passthru.tests = {
inherit (tests) test-bash;
};
} ./patch-rc-path-bash.sh;
patchRcPathCsh = makeSetupHook {
name = "patch-rc-path-csh";
substitutions = {
sed = "${gnused}/bin/sed";
};
meta = {
description = "Setup-hook to inject source-time PATH prefix to a Csh script";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ ShamrockLee ];
};
passthru.tests = {
inherit (tests) test-csh;
};
} ./patch-rc-path-csh.sh;
patchRcPathFish = makeSetupHook {
name = "patch-rc-path-fish";
meta = {
description = "Setup-hook to inject source-time PATH prefix to a Fish script";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ ShamrockLee ];
};
passthru.tests = {
inherit (tests) test-fish;
};
} ./patch-rc-path-fish.sh;
patchRcPathPosix = makeSetupHook {
name = "patch-rc-path-posix";
substitutions = {
sed = "${gnused}/bin/sed";
};
meta = {
description = "Setup-hook to inject source-time PATH prefix to a POSIX shell script";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ ShamrockLee ];
};
passthru.tests = {
inherit (tests) test-posix;
};
} ./patch-rc-path-posix.sh;
}