Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #46274 from mvnetbiz/libratbag
libratbag: init at v0.9.903
- Loading branch information
Showing
6 changed files
with
111 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{ config, lib, pkgs, ... }: | ||
|
||
with lib; | ||
|
||
let | ||
cfg = config.services.ratbagd; | ||
in | ||
{ | ||
###### interface | ||
|
||
options = { | ||
services.ratbagd = { | ||
enable = mkOption { | ||
default = false; | ||
description = '' | ||
Whether to enable ratbagd for configuring gaming mice. | ||
''; | ||
}; | ||
}; | ||
}; | ||
|
||
###### implementation | ||
|
||
config = mkIf cfg.enable { | ||
# Give users access to the "ratbagctl" tool | ||
environment.systemPackages = [ pkgs.libratbag ]; | ||
|
||
services.dbus.packages = [ pkgs.libratbag ]; | ||
|
||
systemd.packages = [ pkgs.libratbag ]; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
{ stdenv, fetchFromGitHub, meson, ninja, pkgconfig | ||
, glib, systemd, udev, libevdev, gitMinimal, check, valgrind, swig, python3 }: | ||
|
||
stdenv.mkDerivation rec { | ||
name = "libratbag-${version}"; | ||
version = "0.9.903"; | ||
|
||
src = fetchFromGitHub { | ||
owner = "libratbag"; | ||
repo = "libratbag"; | ||
rev = "v${version}"; | ||
sha256 = "0cr5skrb7a5mgj7dkm647ib8336hb88bf11blaf6xldafi8b0jlj"; | ||
}; | ||
|
||
|
||
# todo: python should be in buildInputs, but right now meson propagates | ||
# its own python. see: https://github.com/NixOS/nixpkgs/pull/46020 | ||
nativeBuildInputs = [ | ||
(python3.withPackages (ps: with ps; [ evdev pygobject3 ])) | ||
meson ninja pkgconfig gitMinimal swig check valgrind | ||
]; | ||
|
||
buildInputs = [ glib systemd udev libevdev ]; | ||
|
||
mesonFlags = [ | ||
"-Dsystemd-unit-dir=./lib/systemd/system/" | ||
]; | ||
|
||
meta = with stdenv.lib; { | ||
description = "Configuration library for gaming mice"; | ||
homepage = https://github.com/libratbag/libratbag; | ||
license = licenses.mit; | ||
maintainers = with maintainers; [ mvnetbiz ]; | ||
platforms = platforms.linux; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{ stdenv, meson, ninja, pkgconfig, gettext, fetchFromGitHub, python3 | ||
, wrapGAppsHook, gtk3, glib, desktop-file-utils, appstream-glib, gnome3 }: | ||
|
||
python3.pkgs.buildPythonApplication rec { | ||
pname = "piper-${version}"; | ||
version = "0.2.902"; | ||
|
||
format = "other"; | ||
|
||
src = fetchFromGitHub { | ||
owner = "libratbag"; | ||
repo = "piper"; | ||
rev = version; | ||
sha256 = "1ny0vf8ym9v040cb5h084k5wwn929fnhq9infbdq8f8vvy61magb"; | ||
}; | ||
|
||
nativeBuildInputs = [ meson ninja gettext pkgconfig wrapGAppsHook desktop-file-utils appstream-glib ]; | ||
buildInputs = [ gtk3 glib gnome3.defaultIconTheme python3 ]; | ||
propagatedBuildInputs = with python3.pkgs; [ lxml evdev pygobject3 ]; | ||
|
||
postPatch = '' | ||
chmod +x meson_install.sh # patchShebangs requires executable file | ||
patchShebangs meson_install.sh | ||
''; | ||
|
||
meta = with stdenv.lib; { | ||
description = "GTK frontend for ratbagd mouse config daemon"; | ||
homepage = https://github.com/libratbag/piper; | ||
license = licenses.gpl2; | ||
maintainers = with maintainers; [ mvnetbiz ]; | ||
platforms = platforms.linux; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters