summaryrefslogtreecommitdiff
path: root/pkgs/by-name/wh/whoami/package.nix
blob: d3a7006aceaaf09159bf6b79a33c116c14d0b913 (about) (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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
{
  lib,
  buildGoModule,
  fetchFromGitHub,
  nixosTests,
  nix-update-script,
}:

buildGoModule (finalAttrs: {
  pname = "whoami";
  version = "1.11.0";

  src = fetchFromGitHub {
    owner = "traefik";
    repo = "whoami";
    tag = "v${finalAttrs.version}";
    hash = "sha256-3jzLdCmmts/7S1Oxig9Dg3kRGh/H5l5UD7ztev0yvXY=";
  };

  vendorHash = "sha256-0Qxw+MUYVgzgWB8vi3HBYtVXSq/btfh4ZfV/m1chNrA=";

  ldflags = [ "-s" ];

  env.CGO_ENABLED = 0;

  doInstallCheck = true;
  installCheckPhase = ''
    runHook preInstallCheck

    $out/bin/whoami --help 2> /dev/null

    runHook postInstallCheck
  '';

  passthru = {
    tests = { inherit (nixosTests) whoami; };
    updateScript = nix-update-script { };
  };

  meta = {
    description = "Tiny Go server that prints os information and HTTP request to output";
    mainProgram = "whoami";
    homepage = "https://github.com/traefik/whoami";
    changelog = "https://github.com/traefik/whoami/releases/tag/v${finalAttrs.version}";
    license = lib.licenses.asl20;
    maintainers = with lib.maintainers; [
      dvcorreia
      defelo
    ];
  };
})