add headsetcontrol and tray icon

This commit is contained in:
Lumpiasty committed 2026-10-03 00:01:29 +02:00
1 parent 39cc4b813c
commit 02a5d12d91
4 files changed
+67

No files matched your search

+1
View File
@@ -24,5 +24,6 @@
desktop/pulseaudio.nix
desktop/audio-rt.nix
desktop/tailscale.nix
desktop/headsetcontrol.nix
];
}
+6
View File
@@ -0,0 +1,6 @@
{ config, lib, pkgs, modulesPath, ... }:
{
environment.systemPackages = [ pkgs.headsetcontrol pkgs.headset-battery-indicator ];
services.udev.packages = [ pkgs.headsetcontrol ]; # for udev rules
}
+1
View File
@@ -12,5 +12,6 @@
(final.lib.versionOlder prev.networkmanager.version "1.59")
"nixpkgs now ships NetworkManager ${prev.networkmanager.version} >= 1.59 — remove the override in overlays/pkgs.nix and pkgs/networkmanager-dev/ if the patches are no longer needed";
prev.callPackage ../pkgs/networkmanager-dev/package.nix { };
headset-battery-indicator = final.callPackage ../pkgs/headset-battery-indicator/package.nix { };
})
]
@@ -0,0 +1,59 @@
{
lib,
python3Packages,
fetchFromGitHub,
qt6,
headsetcontrol,
xdg-utils,
}:
python3Packages.buildPythonApplication rec {
pname = "headset-battery-indicator";
version = "2.3.2";
pyproject = true;
src = fetchFromGitHub {
owner = "ruflas";
repo = "headset-battery-indicator";
tag = "v${version}";
hash = "sha256-e9o8ECUjmu+G8OgEKjtshs1mFz4EXh30xrwL5Fx3lcQ=";
};
build-system = [ python3Packages.setuptools ];
dependencies = [ python3Packages.pyside6 ];
nativeBuildInputs = [ qt6.wrapQtAppsHook ];
buildInputs = [ qt6.qtbase qt6.qtwayland ];
nativeCheckInputs = with python3Packages; [ pytestCheckHook pytest-qt ];
preCheck = ''
export QT_QPA_PLATFORM=offscreen
export HOME=$(mktemp -d)
'';
postInstall = ''
install -Dm644 headset-battery-indicator.png \
$out/share/icons/hicolor/512x512/apps/headset-battery-indicator.png
install -Dm644 headset-battery-indicator.desktop \
$out/share/applications/headset-battery-indicator.desktop
'';
dontWrapQtApps = true;
preFixup = ''
makeWrapperArgs+=(
"''${qtWrapperArgs[@]}"
--prefix PATH : ${lib.makeBinPath [ headsetcontrol xdg-utils ]}
)
'';
pythonImportsCheck = [ "headset_battery_indicator" ];
meta = {
description = "Tray indicator for wireless headset battery level, based on HeadsetControl";
homepage = "https://github.com/ruflas/headset-battery-indicator";
license = lib.licenses.gpl3Plus;
platforms = lib.platforms.linux;
mainProgram = "headset-battery-indicator";
};
}