gosmee: migrate to finalAttrs pattern and add best practices (#480838)

This commit is contained in:
Jörg Thalheim
2026-01-17 11:05:20 +00:00
committed by GitHub
+14 -4
View File
@@ -4,24 +4,27 @@
buildGoModule,
fetchFromGitHub,
installShellFiles,
versionCheckHook,
nix-update-script,
}:
buildGoModule rec {
buildGoModule (finalAttrs: {
pname = "gosmee";
version = "0.28.3";
src = fetchFromGitHub {
owner = "chmouel";
repo = "gosmee";
rev = "v${version}";
tag = "v${finalAttrs.version}";
hash = "sha256-97Z/q0cOX4zPGYaeAKqxm3sb7WfJ1fpUcMhuqHsPG1c=";
};
vendorHash = null;
nativeBuildInputs = [ installShellFiles ];
postPatch = ''
printf ${version} > gosmee/templates/version
printf ${finalAttrs.version} > gosmee/templates/version
'';
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
@@ -31,13 +34,20 @@ buildGoModule rec {
--zsh <($out/bin/gosmee completion zsh)
'';
doInstallCheck = true;
nativeInstallCheckInputs = [ versionCheckHook ];
passthru.updateScript = nix-update-script { };
meta = {
description = "Command line server and client for webhooks deliveries (and https://smee.io)";
homepage = "https://github.com/chmouel/gosmee";
changelog = "https://github.com/chmouel/gosmee/releases/tag/v${finalAttrs.version}";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [
vdemeester
chmouel
];
mainProgram = "gosmee";
};
}
})