diff --git a/pkgs/by-name/to/totp-cli/package.nix b/pkgs/by-name/to/totp-cli/package.nix new file mode 100644 index 000000000000..39db0a9682cc --- /dev/null +++ b/pkgs/by-name/to/totp-cli/package.nix @@ -0,0 +1,38 @@ +{ + lib, + buildGoModule, + fetchFromGitHub, + installShellFiles, +}: +let + pname = "totp-cli"; + version = "1.8.7"; +in +buildGoModule { + inherit pname version; + + src = fetchFromGitHub { + owner = "yitsushi"; + repo = "totp-cli"; + rev = "refs/tags/v${version}"; + hash = "sha256-WCPDrKGIRrYJFeozXtf8YPgHJ8m6DAsMBD8Xgjvclvc="; + }; + + vendorHash = "sha256-VTlSnw3TyVOQPU+nMDhRtyUrBID2zesGeG2CgDyjwWY="; + + 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"; + }; +}