nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 buildGoModule,
5 fetchFromGitHub,
6 installShellFiles,
7 versionCheckHook,
8 nix-update-script,
9}:
10
11buildGoModule (finalAttrs: {
12 pname = "gosmee";
13 version = "0.28.3";
14
15 src = fetchFromGitHub {
16 owner = "chmouel";
17 repo = "gosmee";
18 tag = "v${finalAttrs.version}";
19 hash = "sha256-97Z/q0cOX4zPGYaeAKqxm3sb7WfJ1fpUcMhuqHsPG1c=";
20 };
21
22 vendorHash = null;
23
24 nativeBuildInputs = [ installShellFiles ];
25
26 postPatch = ''
27 printf ${finalAttrs.version} > gosmee/templates/version
28 '';
29
30 postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
31 installShellCompletion --cmd gosmee \
32 --bash <($out/bin/gosmee completion bash) \
33 --fish <($out/bin/gosmee completion fish) \
34 --zsh <($out/bin/gosmee completion zsh)
35 '';
36
37 doInstallCheck = true;
38 nativeInstallCheckInputs = [ versionCheckHook ];
39
40 passthru.updateScript = nix-update-script { };
41
42 meta = {
43 description = "Command line server and client for webhooks deliveries (and https://smee.io)";
44 homepage = "https://github.com/chmouel/gosmee";
45 changelog = "https://github.com/chmouel/gosmee/releases/tag/v${finalAttrs.version}";
46 license = lib.licenses.asl20;
47 maintainers = with lib.maintainers; [
48 vdemeester
49 chmouel
50 ];
51 mainProgram = "gosmee";
52 };
53})