Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Package request: logiops #122208

Closed
hawkw opened this issue May 8, 2021 · 10 comments
Closed

Package request: logiops #122208

hawkw opened this issue May 8, 2021 · 10 comments

Comments

@hawkw
Copy link

hawkw commented May 8, 2021

Project description

An unofficial driver for Logitech mice and keyboards.

This allows things like setting keymappings for the additional buttons on Logitech mice, changing DPI, etc.

Metadata

@hawkw
Copy link
Author

hawkw commented May 8, 2021

I'm happy to try to package this myself, but I'm relatively new to writing Nix packages, so I might need some guidance.

It would also be nice if there were nixos options for this package --- it has a systemd service and a configuration file.

@zeorin
Copy link
Contributor

zeorin commented May 13, 2021

I'm interested, too. I got a Logitec mouse last week and I've been trying to get this to build:

{ pkgs ? import <nixpkgs> {} }:

with pkgs; stdenv.mkDerivation rec {
  pname = "logiops";
  version = "0.2.3";
  src = fetchFromGitHub {
    owner = "PixlOne";
    repo = "logiops";
    rev = "v${version}";
    sha256 = "1wgv6m1kkxl0hppy8vmcj1237mr26ckfkaqznj1n6cy82vrgdznn";
  };
  nativeBuildInputs = [ cmake pkg-config ];
  buildInputs = [ libevdev libudev libconfig ];
}

is as far as I've gotten. When I try to build this it seems to compile just fine, but CMake tries to install the service file in a systemd directory, which isn't writeable. I don't know enough about how this ought to be handled to solve it myself.

@zeorin
Copy link
Contributor

zeorin commented May 13, 2021

Actually, I've just figured out how to stop CMake from trying to install that file, need to apply this patch:

diff --git i/src/logid/CMakeLists.txt w/src/logid/CMakeLists.txt
index 00ee796..c8300a5 100644
--- i/src/logid/CMakeLists.txt
+++ w/src/logid/CMakeLists.txt
@@ -96,10 +96,6 @@ if (SYSTEMD_FOUND AND "${SYSTEMD_SERVICES_INSTALL_DIR}" STREQUAL "")
     string(REGEX REPLACE "[ \t\n]+" "" SYSTEMD_SERVICES_INSTALL_DIR
            "${SYSTEMD_SERVICES_INSTALL_DIR}")
     configure_file(logid.service.cmake ${CMAKE_BINARY_DIR}/logid.service)
-    message(STATUS "systemd units will be installed at ${SYSTEMD_SERVICES_INSTALL_DIR}")
-    install(FILES ${CMAKE_BINARY_DIR}/logid.service
-            DESTINATION ${SYSTEMD_SERVICES_INSTALL_DIR}
-            COMPONENT cp)
 elseif(NOT SYSTEMD_FOUND AND SYSTEMD_SERVICES_INSTALL_DIR)
     message(FATAL_ERROR "systemd is not found w/ pkg-config but SYSTEMD_SERVICES_INSTALL_DIR is defined.")
 endif()

@zeorin
Copy link
Contributor

zeorin commented May 13, 2021

I managed to get everything working, even wrote a NixOS module. But, I'm a noob at writing packages and modules, and I may need some hand-holding to get this to production-quality (e.g. right now all of the config for the logiops service I created is all just one big extraConfig string).

I'll draft a proper PR for this in the next few days.

@hawkw
Copy link
Author

hawkw commented May 13, 2021

I have a mostly working package for logiops on my machine, as well, also including a half-finished NixOS module. If you want to compare notes, let me know --- I'm also pretty new to packaging things for nix.

@hawkw
Copy link
Author

hawkw commented May 13, 2021

(e.g. right now all of the config for the logiops service I created is all just one big extraConfig string).

FWIW, I started on defining the config in Nix, rather than a big string --- I could probably get it working fairly soon and we could add that to your change.

@zeorin zeorin mentioned this issue May 23, 2021
9 tasks
@zeorin
Copy link
Contributor

zeorin commented May 23, 2021

Draft PR here: #124158

zeorin added a commit to zeorin/nixpkgs that referenced this issue May 23, 2021
Package requested in NixOS#122208
zeorin added a commit to zeorin/nixpkgs that referenced this issue May 23, 2021
Service definition for logiops, which was requested in NixOS#122208.
@anund
Copy link
Contributor

anund commented Jul 27, 2022

See #167388, @ckiee has packaged logiops and is working on a module.

@ckiee
Copy link
Member

ckiee commented Jul 27, 2022

The module is basically done and I've been using it for 4 months now. Just need someone to review.

@patka-123
Copy link
Contributor

Hello @hawkw 👋

logiops seems to have been packaged by now. If this is satisfactory for you, would you be able to close this issue?

(I'm going through issues marked as stale to see what can be resolved.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants