about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/misc/noti/default.nix
blob: 23646abe787564805d3c4634c9931196ae85678b (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
{ stdenv, buildGoPackage, fetchFromGitHub, Cocoa }:

buildGoPackage rec {
  name = "noti-${version}";
  version = "3.1.0";

  src = fetchFromGitHub {
    owner = "variadico";
    repo = "noti";
    rev = "${version}";
    sha256 = "1chsqfqk0pnhx5k2nr4c16cpb8m6zv69l1jvv4v4903zgfzcm823";
  };

  buildInputs = stdenv.lib.optionals stdenv.isDarwin [ Cocoa ];
  # TODO: Remove this when we update apple_sdk
  NIX_CFLAGS_COMPILE = stdenv.lib.optionals stdenv.isDarwin [ "-fno-objc-arc" ];

  goPackagePath = "github.com/variadico/noti";

  preBuild = ''
    buildFlagsArray+=("-ldflags" "-X ${goPackagePath}/internal/command.Version=${version}")
  '';

  postInstall = ''
    mkdir -p $out/share/man/man{1,5}/
    cp $src/docs/man/noti.1      $out/share/man/man1/
    cp $src/docs/man/noti.yaml.5 $out/share/man/man5/
  '';

  meta = with stdenv.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 = [ maintainers.stites ];
    platforms = platforms.all;
  };
}