depot/pkgs/build-support/setup-hooks/patch-rc-path-hooks/default.nix
Luke Granger-Brown 57725ef3ec Squashed 'third_party/nixpkgs/' content from commit 76612b17c0ce
git-subtree-dir: third_party/nixpkgs
git-subtree-split: 76612b17c0ce71689921ca12d9ffdc9c23ce40b2
2024-11-10 23:59:47 +00:00

60 lines
1.6 KiB
Nix

{ lib
, callPackage
, makeSetupHook
, gnused
}:
let
tests = import ./test { inherit callPackage; };
in
{
patchRcPathBash = makeSetupHook
{
name = "patch-rc-path-bash";
meta = with lib; {
description = "Setup-hook to inject source-time PATH prefix to a Bash/Ksh/Zsh script";
maintainers = with 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 = with lib; {
description = "Setup-hook to inject source-time PATH prefix to a Csh script";
maintainers = with maintainers; [ ShamrockLee ];
};
passthru.tests = {
inherit (tests) test-csh;
};
} ./patch-rc-path-csh.sh;
patchRcPathFish = makeSetupHook
{
name = "patch-rc-path-fish";
meta = with lib; {
description = "Setup-hook to inject source-time PATH prefix to a Fish script";
maintainers = with 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 = with lib; {
description = "Setup-hook to inject source-time PATH prefix to a POSIX shell script";
maintainers = with maintainers; [ ShamrockLee ];
};
passthru.tests = {
inherit (tests) test-posix;
};
} ./patch-rc-path-posix.sh;
}