handheld-daemon: touchup code style to better match nixpkgs

Co-authored-by: h7x4 <h7x4@nani.wtf>
Co-authored-by: Luke Granger-Brown <git@lukegb.com>
Co-authored-by: Bruno BELANYI <bruno@belanyi.fr>
This commit is contained in:
Brenton Simpson 2024-01-22 11:12:04 -08:00
parent 3bfa7c5710
commit b960a217bd
2 changed files with 13 additions and 12 deletions

View File

@ -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";

View File

@ -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 = ''