summaryrefslogtreecommitdiffstats
path: root/pkgs/by-name/to/totp-cli/package.nix
blob: fe1ec8b4e445364498b9189041d83a22bee85e7d (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
{
  lib,
  buildGoModule,
  fetchFromGitHub,
  installShellFiles,
}:

buildGoModule (finalAttrs: {
  pname = "totp-cli";
  version = "1.9.2";

  src = fetchFromGitHub {
    owner = "yitsushi";
    repo = "totp-cli";
    tag = "v${finalAttrs.version}";
    hash = "sha256-JPS4LXEgFM+RJhJG9w/SmEYmq6kILie139UrFGyZ2q0=";
  };

  vendorHash = "sha256-GulRmDKatbu4N29Th4rUiVSvvg4hhepyx5X8TLLJ9kQ=";

  nativeBuildInputs = [ installShellFiles ];

  postInstall = ''
    installShellCompletion --bash autocomplete/bash_autocomplete
    installShellCompletion --zsh autocomplete/zsh_autocomplete
  '';

  meta = {
    description = "Authy/Google Authenticator like TOTP CLI tool written in Go";
    changelog = "https://github.com/yitsushi/totp-cli/releases/";
    homepage = "https://yitsushi.github.io/totp-cli/";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ luftmensch-luftmensch ];
    mainProgram = "totp-cli";
  };
})