diff --git a/nixos/modules/services/hardware/handheld-daemon.nix b/nixos/modules/services/hardware/handheld-daemon.nix index 81859bf5b122..e8a7a39f441d 100644 --- a/nixos/modules/services/hardware/handheld-daemon.nix +++ b/nixos/modules/services/hardware/handheld-daemon.nix @@ -9,6 +9,7 @@ in { options.services.handheld-daemon = { enable = mkEnableOption "Enable Handheld Daemon"; + package = mkPackageOption pkgs "handheld-daemon" { }; user = mkOption { type = types.str; @@ -19,9 +20,9 @@ in }; config = mkIf cfg.enable { - environment.systemPackages = [ pkgs.handheld-daemon ]; - services.udev.packages = [ pkgs.handheld-daemon ]; - systemd.packages = [ pkgs.handheld-daemon ]; + environment.systemPackages = [ cfg.package ]; + services.udev.packages = [ cfg.package ]; + systemd.packages = [ cfg.package ]; systemd.services.handheld-daemon = { description = "Handheld Daemon"; @@ -31,7 +32,7 @@ in restartIfChanged = true; serviceConfig = { - ExecStart = "${ pkgs.handheld-daemon }/bin/hhd --user ${ cfg.user }"; + ExecStart = "${ lib.getExe cfg.package } --user ${ cfg.user }"; Nice = "-12"; Restart = "on-failure"; RestartSec = "10"; diff --git a/pkgs/by-name/ha/handheld-daemon/package.nix b/pkgs/by-name/ha/handheld-daemon/package.nix index 7df459cc9add..bb0c9d65bfe1 100644 --- a/pkgs/by-name/ha/handheld-daemon/package.nix +++ b/pkgs/by-name/ha/handheld-daemon/package.nix @@ -9,28 +9,28 @@ python3.pkgs.buildPythonApplication rec { pname = "handheld-daemon"; version = "1.1.0"; - format = "pyproject"; + pyproject = true; src = fetchFromGitHub { owner = "hhd-dev"; repo = "hhd"; - rev = "abe34c6841476f5b41afe30ee18ff3e510402d68"; + rev = "v${version}"; hash = "sha256-ovLC1BQ98jUaDEMPBzWma4TYSzTF+yE/cMemFdJmqlE="; }; - pythonPath = with python3.pkgs; [ - evdev - pyyaml - rich - ]; - propagatedBuildInputs = with python3.pkgs; [ + evdev hidapi kmod + pyyaml + rich setuptools toybox ]; + # This package doesn't have upstream tests. + doCheck = false; + # handheld-daemon contains a fork of the python module `hid`, so this hook # is borrowed from the `hid` derivation. postPatch = ''