1{ buildGoModule
2, fetchFromGitHub
3, makeWrapper
4, lib
5, openssh
6, testers
7, vault-ssh-plus
8}:
9buildGoModule rec {
10 pname = "vault-ssh-plus";
11 version = "0.7.3";
12
13 src = fetchFromGitHub {
14 owner = "isometry";
15 repo = pname;
16 rev = "v${version}";
17 hash = "sha256-IRmFC5WsLmHfPjS/jW5V7dNF5rNvmsh3YKwW7rGII24=";
18 };
19
20 vendorHash = "sha256-cuU7rEpJrwrbiXLajdv4h6GePbpZclweyB9qZ3SIjP0=";
21
22 nativeBuildInputs = [ makeWrapper ];
23
24 ldflags = [
25 "-s"
26 "-w"
27 "-X main.version=${version}"
28 ];
29
30 postInstall = ''
31 mv $out/bin/vault-ssh-plus $out/bin/vssh
32 wrapProgram $out/bin/vssh --prefix PATH : ${lib.makeBinPath [ openssh ]};
33 '';
34
35 passthru.tests.version = testers.testVersion {
36 package = vault-ssh-plus;
37 command = "vssh --version";
38 version = "v${version}";
39 };
40
41 meta = with lib; {
42 homepage = "https://github.com/isometry/vault-ssh-plus";
43 changelog = "https://github.com/isometry/vault-ssh-plus/releases/tag/v${version}";
44 description = "Automatically use HashiCorp Vault SSH Client Key Signing with ssh(1)";
45 mainProgram = "vssh";
46 license = licenses.mit;
47 maintainers = with maintainers; [ lesuisse ];
48 };
49}