bark-server: 2.1.9 -> 2.2.0; migrate to finalAttrs; add updateScript; (#399828)

This commit is contained in:
Lin Jian
2025-04-27 15:14:46 +08:00
committed by GitHub
+15 -9
View File
@@ -3,17 +3,18 @@
buildGoModule,
fetchFromGitHub,
versionCheckHook,
nix-update-script,
}:
buildGoModule rec {
buildGoModule (finalAttrs: {
pname = "bark-server";
version = "2.1.9";
version = "2.2.0";
src = fetchFromGitHub {
owner = "Finb";
repo = "bark-server";
tag = "v${version}";
hash = "sha256-bZWX47krx9V0qXg6Yl8yQbX1zd5DtsWkIBLi0bDxrpA=";
tag = "v${finalAttrs.version}";
hash = "sha256-c3kMGD4JuLAP/Ms2dJBAl85urvranGGIicTmx4gIhNM=";
# populate values that require us to use git. By doing this in postFetch we
# can delete .git afterwards and maintain better reproducibility of the src.
leaveDotGit = true;
@@ -31,14 +32,17 @@ buildGoModule rec {
ldflags = [
"-s"
"-w"
"-X main.version=${version}"
"-X main.version=${finalAttrs.version}"
];
preBuild = ''
ldflags+=" -X \"main.buildDate=$(cat SOURCE_DATE_EPOCH)\""
ldflags+=" -X main.commitID==$(cat COMMIT)"
ldflags+=" -X \"main.buildDate=$(<SOURCE_DATE_EPOCH)\""
ldflags+=" -X main.commitID==$(<COMMIT)"
'';
# All tests require network
doCheck = false;
doInstallCheck = true;
versionCheckProgramArg = "-v";
@@ -47,12 +51,14 @@ buildGoModule rec {
versionCheckHook
];
passthru.updateScript = nix-update-script { };
meta = {
description = "Backend of Bark, an iOS App which allows you to push customed notifications to your iPhone";
homepage = "https://github.com/Finb/bark-server";
changelog = "https://github.com/Finb/bark-server/releases/tag/v${version}";
changelog = "https://github.com/Finb/bark-server/releases/tag/v${finalAttrs.version}";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ moraxyc ];
mainProgram = "bark-server";
};
}
})