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