diff --git a/pkgs/by-name/br/brutus/package.nix b/pkgs/by-name/br/brutus/package.nix new file mode 100644 index 000000000000..a3a63fcd9ee6 --- /dev/null +++ b/pkgs/by-name/br/brutus/package.nix @@ -0,0 +1,41 @@ +{ + lib, + buildGoModule, + fetchFromGitHub, + versionCheckHook, +}: + +buildGoModule (finalAttrs: { + pname = "brutus"; + version = "1.2.0"; + + src = fetchFromGitHub { + owner = "praetorian-inc"; + repo = "brutus"; + tag = "v${finalAttrs.version}"; + hash = "sha256-HsQZqHILko3FTzBH1pJ3HBpfdaOoWH+xPq0l10/CAB8="; + }; + + vendorHash = "sha256-1hP4gitbpm3wFhLu7OJ3gQMVkZKZJEZAKvhfejSOYMI="; + + ldflags = [ + "-s" + "-X=main.Version=${finalAttrs.version}" + "-X=main.BuildTime=1970-01-01T00:00:00Z" + "-X=main.CommitSHA=${finalAttrs.src.rev}" + ]; + + nativeInstallCheckInputs = [ versionCheckHook ]; + + doInstallCheck = true; + + versionCheckProgramArg = [ "--version" ]; + + meta = { + description = "Credential testing tool for multiple services"; + homepage = "https://github.com/praetorian-inc/brutus"; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ fab ]; + mainProgram = "brutus"; + }; +})