zaphyra's git: nixfiles

zaphyra's nixfiles

1 
2 
3 
4 
5 
6 
7 
8 
9 
10 
11 
12 
13 
14 
15 
16 
17 
18 
19 
20 
21 
22 
23 
24 
25 
26 
27 
28 
29 
30 
31 
32 
33 
34 
35 
36 
37 
38 
39 
40 
41 
42 
43 
44 
45 
46 
47 
48 
49 
50 
51 
52 
53 
54 
55 
56 
{
  lib,
  fetchFromGitHub,
  stdenv,
  pkg-config,
  gtk4,
  gtk4-layer-shell,
  json-glib,
  ...
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "echo-meter";
  version = "0.0.0-unstable-2025-08-26";
  rev = "e6e5a70600e85edcfca3aa44153a26614b6fe55c";
  srcHash = "sha256-QPQ3crm7i0L0PivlhIsPLrv1TNVwF/c+WQDRK4EtEV8=";

  src = fetchFromGitHub {
    owner = "Nithin-3";
    repo = finalAttrs.pname;
    hash = finalAttrs.srcHash;
    inherit (finalAttrs) rev;
  };

  postPatch = ''
    substituteInPlace src/echo-meter.c \
      --replace-fail "gtk-layer-shell/gtk-layer-shell.h" "gtk4-layer-shell/gtk4-layer-shell.h"
  '';

  nativeBuildInputs = [
    pkg-config
  ];

  buildInputs = [
    gtk4
    gtk4-layer-shell
    json-glib
  ];

  installPhase = ''
    mkdir -p $out/bin

    cp ./echo-meter $out/bin
    cp -r ./assets $out/share
  '';

  meta = {
    description = "A lightweight GTK4 layer-shell application that displays always-on-top real-time audio, brightness, and microphone level indicators.";
    homepage = "https://github.com/Nithin-3/echo-meter";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ zaphyra ];
    platforms = lib.platforms.linux;
    mainProgram = "echo-meter";
  };

})