ckb: init at 0.2.6

ckb is a driver for Corsair keyboards/mice. It also contains a graphical tool for configuring their LED backlight settings.

The driver is implemented as a userland daemon. A NixOS module is included that runs this as a systemd service.

+97
+40
nixos/modules/hardware/ckb.nix
··· 1 + { config, lib, pkgs, ... }: 2 + 3 + with lib; 4 + 5 + let 6 + cfg = config.hardware.ckb; 7 + 8 + in 9 + { 10 + options.hardware.ckb = { 11 + enable = mkEnableOption "the Corsair keyboard/mouse driver"; 12 + 13 + package = mkOption { 14 + type = types.package; 15 + default = pkgs.ckb; 16 + defaultText = "pkgs.ckb"; 17 + description = '' 18 + The package implementing the Corsair keyboard/mouse driver. 19 + ''; 20 + }; 21 + }; 22 + 23 + config = mkIf cfg.enable { 24 + environment.systemPackages = [ cfg.package ]; 25 + 26 + systemd.services.ckb = { 27 + description = "Corsair Keyboard Daemon"; 28 + wantedBy = ["multi-user.target"]; 29 + script = "${cfg.package}/bin/ckb-daemon"; 30 + serviceConfig = { 31 + Restart = "always"; 32 + StandardOutput = "syslog"; 33 + }; 34 + }; 35 + }; 36 + 37 + meta = { 38 + maintainers = with lib.maintainers; [ kierdavis ]; 39 + }; 40 + }
+12
pkgs/tools/misc/ckb/ckb-animations-location.patch
··· 1 + diff --git a/src/ckb/animscript.cpp b/src/ckb/animscript.cpp 2 + index d0b7f46..d7a3459 100644 3 + --- a/src/ckb/animscript.cpp 4 + +++ b/src/ckb/animscript.cpp 5 + @@ -30,7 +30,7 @@ QString AnimScript::path(){ 6 + #ifdef __APPLE__ 7 + return QDir(QApplication::applicationDirPath() + "/../Resources").absoluteFilePath("ckb-animations"); 8 + #else 9 + - return QDir(QApplication::applicationDirPath()).absoluteFilePath("ckb-animations"); 10 + + return QDir(QApplication::applicationDirPath() + "/../libexec").absoluteFilePath("ckb-animations"); 11 + #endif 12 + }
+43
pkgs/tools/misc/ckb/default.nix
··· 1 + { stdenv, fetchFromGitHub, libudev, pkgconfig, qtbase, qmakeHook, zlib }: 2 + 3 + stdenv.mkDerivation rec { 4 + version = "0.2.6"; 5 + name = "ckb-${version}"; 6 + 7 + src = fetchFromGitHub { 8 + owner = "ccMSC"; 9 + repo = "ckb"; 10 + rev = "v${version}"; 11 + sha256 = "04h50qdzsbi77mj62jghr52i35vxvmhnvsb7pdfdq95ryry8bnwm"; 12 + }; 13 + 14 + buildInputs = [ 15 + libudev 16 + qtbase 17 + zlib 18 + ]; 19 + 20 + nativeBuildInputs = [ 21 + pkgconfig 22 + qmakeHook 23 + ]; 24 + 25 + patches = [ 26 + ./ckb-animations-location.patch 27 + ]; 28 + 29 + doCheck = false; 30 + 31 + installPhase = '' 32 + install -D --mode 0755 --target-directory $out/bin bin/ckb-daemon bin/ckb 33 + install -D --mode 0755 --target-directory $out/libexec/ckb-animations bin/ckb-animations/* 34 + ''; 35 + 36 + meta = with stdenv.lib; { 37 + description = "Driver and configuration tool for Corsair keyboards and mice"; 38 + homepage = https://github.com/ccMSC/ckb; 39 + license = licenses.gpl2; 40 + platforms = platforms.linux; 41 + maintainers = with maintainers; [ kierdavis ]; 42 + }; 43 + }
+2
pkgs/top-level/all-packages.nix
··· 1267 1267 1268 1268 cloud-utils = callPackage ../tools/misc/cloud-utils { }; 1269 1269 1270 + ckb = qt5.callPackage ../tools/misc/ckb { }; 1271 + 1270 1272 compass = callPackage ../development/tools/compass { }; 1271 1273 1272 1274 convmv = callPackage ../tools/misc/convmv { };