diff --git a/hosts/pacifidlog/adjustor.nix b/hosts/pacifidlog/adjustor.nix new file mode 100644 index 00000000..bb2685f6 --- /dev/null +++ b/hosts/pacifidlog/adjustor.nix @@ -0,0 +1,36 @@ + +{ fetchFromGitHub +, lib +, python3 +}: +python3.pkgs.buildPythonApplication rec { + pname = "adjustor"; + version = "3.4.5"; + pyproject = true; + + src = fetchFromGitHub { + owner = "hhd-dev"; + repo = "adjustor"; + rev = "v${version}"; + hash = "sha256-tde9FfP9MVOw1/0c4y8fQxVNmvvqjPG97S4bphOdqws="; + }; + + propagatedBuildInputs = with python3.pkgs; [ + setuptools + rich + pyroute2 + fuse + pygobject3 + dbus-python + ]; + + # This package doesn't have upstream tests. + doCheck = false; + + meta = with lib; { + homepage = "https://github.com/hhd-dev/adjustor/"; + description = "Allows for TDP control of AMD Handhelds under handheld-daemon support"; + platforms = platforms.linux; + license = licenses.mit; + }; +} \ No newline at end of file diff --git a/hosts/pacifidlog/default.nix b/hosts/pacifidlog/default.nix index babb4b76..a938622f 100644 --- a/hosts/pacifidlog/default.nix +++ b/hosts/pacifidlog/default.nix @@ -1,6 +1,7 @@ # Lenovo Legion Go { config, + pkgs, lib, self, ... @@ -87,9 +88,19 @@ }) ]; - services.handheld-daemon = { + services.handheld-daemon = let + adjustor = pkgs.callPackage ./adjustor.nix {}; + in { enable = true; user = "aly"; + package = with pkgs; + handheld-daemon.overrideAttrs (oldAttrs: { + propagatedBuildInputs = + oldAttrs.propagatedBuildInputs + ++ [ + adjustor + ]; + }); }; system.stateVersion = "24.11";