Skip to content

Commit ccfe830

Browse files
committed
gotify-server: modernize
- Use finalAttrs. - Add missing ldflags https://github.com/gotify/server/blob/v2.6.3/.github/workflows/build.yml#L33.
1 parent 5c6d52c commit ccfe830

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

pkgs/by-name/go/gotify-server/package.nix

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,20 @@
88
nix-update-script,
99
}:
1010

11-
buildGoModule rec {
11+
buildGoModule (finalAttrs: {
1212
pname = "gotify-server";
1313
version = "2.6.3";
1414

1515
src = fetchFromGitHub {
1616
owner = "gotify";
1717
repo = "server";
18-
rev = "v${version}";
18+
tag = "v${finalAttrs.version}";
1919
hash = "sha256-9vIReA29dWf3QwUYEW8JhzF9o74JZqG4zGobgI+gIWE=";
2020
};
2121

2222
vendorHash = "sha256-rs6EfnJT6Jgif2TR5u5Tp5/Ozn+4uhSapksyKFnQiCo=";
2323

24+
# No test
2425
doCheck = false;
2526

2627
buildInputs = [
@@ -39,7 +40,7 @@ buildGoModule rec {
3940
passthru = {
4041
# For nix-update to detect the location of this attribute from this
4142
# derivation.
42-
inherit (ui) offlineCache;
43+
inherit (finalAttrs.ui) offlineCache;
4344
updateScript = nix-update-script { };
4445
tests = {
4546
nixos = nixosTests.gotify-server;
@@ -50,16 +51,21 @@ buildGoModule rec {
5051
# produce binaries which panic when executed and are not interesting at all
5152
subPackages = [ "." ];
5253

54+
# Based on LD_FLAGS in upstream's .github/workflows/build.yml:
55+
# https://github.com/gotify/server/blob/v2.6.3/.github/workflows/build.yml#L33
5356
ldflags = [
54-
"-X main.Version=${version}"
57+
"-s"
58+
"-X main.Version=${finalAttrs.version}"
5559
"-X main.Mode=prod"
60+
"-X main.Commit=refs/tags/v${finalAttrs.version}"
61+
"-X main.BuildDate=unknown"
5662
];
5763

58-
meta = with lib; {
64+
meta = {
5965
description = "Simple server for sending and receiving messages in real-time per WebSocket";
6066
homepage = "https://gotify.net";
61-
license = licenses.mit;
62-
maintainers = with maintainers; [ doronbehar ];
67+
license = lib.licenses.mit;
68+
maintainers = with lib.maintainers; [ doronbehar ];
6369
mainProgram = "server";
6470
};
65-
}
71+
})

0 commit comments

Comments
 (0)