1{
2 lib,
3 alsa-lib,
4 buildGoModule,
5 fetchFromGitHub,
6 glib,
7 gobject-introspection,
8 gtk4,
9 libadwaita,
10 nix-update-script,
11 pkg-config,
12 wrapGAppsHook4,
13}:
14
15buildGoModule rec {
16 pname = "mpris-timer";
17 version = "2.1.1";
18
19 src = fetchFromGitHub {
20 owner = "efogdev";
21 repo = "mpris-timer";
22 tag = version;
23 hash = "sha256-uFQJSKQ9k0fiOhzydJ7frs2kns9pSdZGILPGCW3QA1w=";
24 };
25
26 vendorHash = "sha256-vCzQiQsljNyI7nBYvq+C/dv0T186Lsj7rOq5xHMs3c0=";
27
28 strictDeps = true;
29
30 nativeBuildInputs = [
31 pkg-config
32 glib
33 wrapGAppsHook4
34 ];
35
36 buildInputs = [
37 alsa-lib
38 gobject-introspection
39 gtk4
40 libadwaita
41 ];
42
43 ldflags = [
44 "-s"
45 "-w"
46 ];
47
48 tags = [
49 "wayland"
50 ];
51
52 postInstall = ''
53 mv $out/bin/cmd $out/bin/mpris-timer
54
55 install -Dm644 internal/ui/res/icon.svg $out/share/icons/hicolor/scalable/apps/io.github.efogdev.mpris-timer.svg
56 install -Dm644 misc/io.github.efogdev.mpris-timer.desktop -t $out/share/applications
57 install -Dm644 misc/io.github.efogdev.mpris-timer.metainfo.xml -t $out/share/metainfo
58 install -Dm644 misc/io.github.efogdev.mpris-timer.gschema.xml -t $out/share/glib-2.0/schemas
59 glib-compile-schemas $out/share/glib-2.0/schemas
60 '';
61
62 passthru = {
63 updateScript = nix-update-script { };
64 };
65
66 meta = {
67 description = "Timer app with seamless GNOME integration";
68 homepage = "https://github.com/efogdev/mpris-timer";
69 license = lib.licenses.mit;
70 maintainers = with lib.maintainers; [
71 stunkymonkey
72 getchoo
73 ];
74 mainProgram = "mpris-timer";
75 # Always uses ALSA
76 platforms = lib.platforms.linux;
77 };
78}