summaryrefslogtreecommitdiffstats
path: root/pkgs/by-name/tm/tmpmail/package.nix
blob: 2ad2af3f6cd6ac3941457778a63c8971c346fe00 (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
{
  lib,
  fetchFromGitHub,
  stdenvNoCC,
  w3m,
  curl,
  jq,
  makeWrapper,
  installShellFiles,
  xclip,
}:

stdenvNoCC.mkDerivation rec {
  pname = "tmpmail";
  version = "1.2.3";

  src = fetchFromGitHub {
    owner = "sdushantha";
    repo = "tmpmail";
    rev = "v${version}";
    sha256 = "sha256-s4c1M4YHK/CNpH7nPt7rRqlkLUZrpBXvAVS/qxCai9c=";
  };

  dontConfigure = true;

  dontBuild = true;

  nativeBuildInputs = [
    makeWrapper
    installShellFiles
  ];

  installPhase = ''
    mkdir -p $out/bin
    install -Dm755 -t $out/bin tmpmail
    installManPage tmpmail.1
    wrapProgram $out/bin/tmpmail --prefix PATH : ${
      lib.makeBinPath [
        w3m
        curl
        jq
        xclip
      ]
    }
  '';

  meta = {
    homepage = "https://github.com/sdushantha/tmpmail";
    description = "Temporary email right from your terminal written in POSIX sh";
    license = lib.licenses.mit;
    maintainers = [ ];
    mainProgram = "tmpmail";
  };
}