summary refs log tree commit diff
path: root/pkgs/build-support/setup-hooks/patch-rc-path-hooks/default.nix
blob: f16644528f002df00d197ad66a16cc0e061cbd41 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
{ 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;
}