summaryrefslogtreecommitdiffstats
path: root/pkgs/by-name/tm/tmpi/package.nix
blob: 49d9f6160bb38566641fc619e71b13bc11cf7159 (plain)
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,
  stdenv,
  fetchFromGitHub,
  mpi,
  mpich,
  tmux,
  reptyr,
  makeWrapper,
}:

stdenv.mkDerivation {
  pname = "tmpi";
  version = "0-unstable-2022-02-22";

  src = fetchFromGitHub {
    owner = "Azrael3000";
    repo = "tmpi";
    rev = "f5a0fd8848b5c87b301edc8a23de9bfcfbd41918";
    hash = "sha256-BaOaMpsF8ho8EIVuHfu4+CiVV3yLoC3tDkLq4R8BYBA=";
  };

  propagatedBuildInputs = [
    mpi
    mpich
    reptyr
    tmux
  ];

  nativeBuildInputs = [ makeWrapper ];

  installPhase = ''
    runHook preInstall

    mkdir -p $out/bin

    install -m755 tmpi $out/bin/tmpi

    wrapProgram $out/bin/tmpi \
      --prefix PATH : ${
        lib.makeBinPath [
          mpi
          mpich
          tmux
          reptyr
        ]
      }

    runHook postInstall
  '';

  meta = {
    description = "Run a parallel command inside a split tmux window";
    mainProgram = "tmpi";
    homepage = "https://github.com/Azrael3000/tmpi";
    license = lib.licenses.gpl2;
    maintainers = with lib.maintainers; [ vasissualiyp ];
    platforms = reptyr.meta.platforms;
  };
}