summary refs log tree commit diff
path: root/pkgs/tools/misc/noti/default.nix
blob: ac3ff7a59b7047efad4065719e49765bf81ac870 (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
{ stdenv
, lib
, buildGoModule
, fetchFromGitHub
, fetchurl
, Cocoa
, installShellFiles
}:

buildGoModule rec {
  pname = "noti";
  version = "3.5.0";

  src = fetchFromGitHub {
    owner = "variadico";
    repo = "noti";
    rev = version;
    sha256 = "12r9wawwl6x0rfv1kahwkamfa0pjq24z60az9pn9nsi2z1rrlwkd";
  };

  patches = [
    # update golang.org/x/sys to fix building on aarch64-darwin
    # using fetchurl because fetchpatch breaks the patch
    (fetchurl {
      url = "https://github.com/variadico/noti/commit/a90bccfdb2e6a0adc2e92f9a4e7be64133832ba9.patch";
      sha256 = "sha256-vSAwuAR9absMSFqGOlzmRZoOGC/jpkmh8CMCVjeleUo=";
    })
  ];

  vendorSha256 = null;

  nativeBuildInputs = [ installShellFiles ];

  buildInputs = lib.optional stdenv.isDarwin Cocoa;

  ldflags = [
    "-s"
    "-w"
    "-X github.com/variadico/noti/internal/command.Version=${version}"
  ];

  postInstall = ''
    installManPage docs/man/*
  '';

  meta = with lib; {
    description = "Monitor a process and trigger a notification";
    longDescription = ''
      Monitor a process and trigger a notification.

      Never sit and wait for some long-running process to finish. Noti can alert you when it's done. You can receive messages on your computer or phone.
    '';
    homepage = "https://github.com/variadico/noti";
    license = licenses.mit;
    maintainers = with maintainers; [ stites marsam ];
  };
}