1{
2 lib,
3 buildGoModule,
4 fetchFromGitHub,
5 nixosTests,
6 nix-update-script,
7}:
8let
9 version = "2.14.1";
10in
11buildGoModule {
12 pname = "wakapi";
13 inherit version;
14
15 src = fetchFromGitHub {
16 owner = "muety";
17 repo = "wakapi";
18 tag = version;
19 hash = "sha256-ujHrb9yXUbUYB0JGftrdTfEeFakgwGJ7EH6e1KnyrnI=";
20 };
21
22 vendorHash = "sha256-eaaU8vqTpgtSSfaaFDg4Bo06lTjvqLkVuidkq25tjb4=";
23
24 # Not a go module required by the project, contains development utilities
25 excludedPackages = [ "scripts" ];
26
27 # Fix up reported version
28 postPatch = ''echo ${version} > version.txt'';
29
30 ldflags = [
31 "-s"
32 "-w"
33 ];
34
35 passthru = {
36 nixos = nixosTests.wakapi;
37 updateScript = nix-update-script { };
38 };
39
40 meta = {
41 homepage = "https://wakapi.dev/";
42 changelog = "https://github.com/muety/wakapi/releases/tag/${version}";
43 description = "Minimalist self-hosted WakaTime-compatible backend for coding statistics";
44 license = lib.licenses.gpl3Only;
45 maintainers = with lib.maintainers; [
46 t4ccer
47 isabelroses
48 ];
49 mainProgram = "wakapi";
50 };
51}