diff --git a/pkgs/by-name/ad/adjustor/package.nix b/pkgs/by-name/ad/adjustor/package.nix index fa58505b520fb..7f6d787ce37d6 100644 --- a/pkgs/by-name/ad/adjustor/package.nix +++ b/pkgs/by-name/ad/adjustor/package.nix @@ -1,9 +1,13 @@ { fetchFromGitHub, lib, - python3, + python3Packages, + + # Dependencies + kmod, + util-linux, }: -python3.pkgs.buildPythonApplication rec { +python3Packages.buildPythonPackage rec { pname = "adjustor"; version = "3.6.1"; pyproject = true; @@ -15,13 +19,28 @@ python3.pkgs.buildPythonApplication rec { hash = "sha256-A5IdwuhsK9umMtsUR7CpREGxbTYuJNPV4MT+6wqcWT8="; }; - propagatedBuildInputs = with python3.pkgs; [ + # This package relies on several programs expected to be on the user's PATH. + # We take a more reproducible approach by patching the absolute path to each of these required + # binaries. + postPatch = '' + substituteInPlace src/adjustor/core/acpi.py \ + --replace-fail '"modprobe"' '"${lib.getExe' kmod "modprobe"}"' + + substituteInPlace src/adjustor/fuse/utils.py \ + --replace-fail 'f"mount' 'f"${lib.getExe' util-linux "mount"}' + ''; + + build-system = with python3Packages; [ setuptools + ]; + + dependencies = with python3Packages; [ rich pyroute2 fuse pygobject3 dbus-python + kmod ]; # This package doesn't have upstream tests.