about summary refs log tree commit diff
path: root/pkgs/applications/misc/madonctl/default.nix
blob: b9a1c0fd537177467d5a6b34406dfd930880f62c (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
{ lib, buildGoModule, fetchFromGitHub, installShellFiles, testers, madonctl }:

buildGoModule rec {
  pname = "madonctl";
  version = "2.3.2";

  src = fetchFromGitHub {
    owner = "McKael";
    repo = "madonctl";
    rev = "v${version}";
    hash = "sha256-mo185EKjLkiujAKcAFM1XqkXWvcfYbnv+r3dF9ywaf8=";
  };

  vendorHash = null;

  nativeBuildInputs = [ installShellFiles ];

  ldflags = [ "-s" "-w" ];

  postInstall = ''
    installShellCompletion --cmd madonctl \
      --bash <($out/bin/madonctl completion bash) \
      --zsh <($out/bin/madonctl completion zsh)
  '';

  passthru.tests.version = testers.testVersion {
    package = madonctl;
    command = "madonctl version";
  };

  meta = with lib; {
    description = "CLI for the Mastodon social network API";
    homepage = "https://github.com/McKael/madonctl";
    license = licenses.mit;
    platforms = platforms.unix;
    maintainers = with maintainers; [ aaronjheng ];
  };
}