-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8139f14
commit d1c9cbd
Showing
9 changed files
with
142 additions
and
72 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -2,5 +2,6 @@ | |
imports = [ | ||
./vfio.nix | ||
./virtualisation.nix | ||
./xp-pentablet.nix | ||
]; | ||
} |
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,35 @@ | ||
{ config, pkgs, lib, ... }: | ||
with lib; | ||
let | ||
cfg = config.services.xserver.xp-pentablet; | ||
dataDir = "/var/lib/xppenconf"; | ||
in | ||
{ | ||
options = { | ||
services.xserver.xp-pentablet = { | ||
enable = mkOption { | ||
type = types.bool; | ||
default = false; | ||
description = lib.mdDoc '' | ||
Whether to enable the xp-pen-tablet. | ||
''; | ||
}; | ||
}; | ||
}; | ||
config = mkIf cfg.enable { | ||
hardware.uinput.enable = true; | ||
|
||
environment.systemPackages = [ pkgs.xp-pentablet ]; # provides xsetwacom | ||
|
||
services.udev.packages = [ pkgs.xp-pentablet ]; | ||
|
||
system.activationScripts.xp-pentablet-config.text = '' | ||
install -m 755 -d "${dataDir}/conf/xppen" | ||
find ${pkgs.xp-pentablet}/usr/lib/pentablet/conf -type f | while read -r file; do | ||
if [ ! -f ${dataDir}/conf/$(basename ''${file}) ]; then | ||
install -m 666 "''${file}" "${dataDir}/conf/xppen/$(basename ''${file})" | ||
fi | ||
done | ||
''; | ||
}; | ||
} |
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,98 @@ | ||
{ lib | ||
, stdenv | ||
, fetchzip | ||
, libusb1 | ||
, glibc | ||
, libGL | ||
, xorg | ||
, makeWrapper | ||
, makeDesktopItem | ||
, qtx11extras | ||
, wrapQtAppsHook | ||
, autoPatchelfHook | ||
, libX11 | ||
, libXtst | ||
, libXi | ||
, libXrandr | ||
, libXinerama | ||
, copyDesktopItems | ||
}: | ||
|
||
let | ||
pname = "xp-pentablet-unwrapped"; | ||
version = "3.4.9-231023"; | ||
dataDir = "var/lib/xppenconf"; | ||
in | ||
stdenv.mkDerivation rec { | ||
inherit pname version; | ||
src = fetchzip { | ||
url = | ||
"https://download01.xp-pen.com/file/2023/11/XPPenLinux${version}.tar.gz"; | ||
name = "XPPenLinux${version}.tar.gz"; | ||
sha256 = "sha256-A/dv6DpelH0NHjlGj32tKv37S+9q3F8cYByiYlMuqLg="; | ||
}; | ||
|
||
nativeBuildInputs = | ||
[ wrapQtAppsHook autoPatchelfHook makeWrapper copyDesktopItems ]; | ||
|
||
dontBuild = true; | ||
dontWrapQtApps = true; # this is done manually | ||
|
||
buildInputs = [ | ||
libusb1 | ||
libX11 | ||
libXtst | ||
libXi | ||
libXrandr | ||
libXinerama | ||
glibc | ||
libGL | ||
stdenv.cc.cc.lib | ||
qtx11extras | ||
]; | ||
|
||
installPhase = '' | ||
runHook preInstall | ||
mkdir -p $out/usr/lib | ||
cp -r App/usr/lib/pentablet $out/usr/lib | ||
chmod +x $out/usr/lib/pentablet/PenTablet* | ||
sed -i 's#usr/lib/pentablet#${dataDir}#g' $out/usr/lib/pentablet/PenTablet | ||
mkdir -p $out/share/icons | ||
cp -r App/usr/share/icons/* $out/share/icons | ||
cp -r App/lib $out/lib | ||
runHook postInstall | ||
''; | ||
|
||
postFixup = '' | ||
makeWrapper $out/usr/lib/pentablet/PenTablet $out/bin/xp-pentablet \ | ||
"''${qtWrapperArgs[@]}" \ | ||
--set QT_QPA_PLATFORM xcb \ | ||
--set QT_XKB_CONFIG_ROOT "${xorg.xkeyboardconfig}/share/X11/xkb" | ||
''; | ||
|
||
desktopItems = [ | ||
(makeDesktopItem { | ||
name = "xppentablet"; | ||
desktopName = "XP Pen Tablet Drivers"; | ||
genericName = "Graphic Tablet Drivers"; | ||
exec = "xp-pentablet"; | ||
icon = "xppentablet"; | ||
comment = "XPPen graphical tablet drivers"; | ||
categories = [ "Utility" "Graphics" ]; | ||
}) | ||
]; | ||
|
||
meta = with lib; { | ||
mainProgram = "xp-pentablet"; | ||
homepage = "https://www.xp-pen.com/"; | ||
description = "Drivers for the XP-PEN drawing tablets"; | ||
platforms = [ "x86_64-linux" ]; | ||
sourceProvenance = with sourceTypes; [ binaryNativeCode ]; | ||
maintainers = with maintainers; [ virchau13 ivar sochotnicky ]; | ||
license = licenses.unfree; | ||
}; | ||
} |
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 |
---|---|---|
|
@@ -16,6 +16,7 @@ | |
shell = pkgs.zsh; | ||
extraGroups = [ | ||
"input" | ||
"uinput" | ||
"uucp" | ||
"wheel" | ||
]; | ||
|