Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions maintainers/maintainer-list.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17602,6 +17602,12 @@
name = "Nasir Hussain";
keys = [ { fingerprint = "7A10 AB8E 0BEC 566B 090C 9BE3 D812 6E55 9CE7 C35D"; } ];
};
nasrally = {
email = "suffer.ring@ya.ru";
github = "nasrally";
githubId = 50599445;
name = "Nikita Grishko";
};
nat-418 = {
github = "nat-418";
githubId = 93013864;
Expand Down
2 changes: 2 additions & 0 deletions nixos/doc/manual/release-notes/rl-2511.section.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@

- [Homebridge](https://github.com/homebridge/homebridge), a lightweight Node.js server you can run on your home network that emulates the iOS HomeKit API. Available as [services.homebridge](#opt-services.homebridge.enable).

- [XPPen](https://www.xp-pen.com/), the official closed-source driver for XP Pen tablets. Available as [programs.xppen](#opt-programs.xppen.enable).

- [LACT](https://github.com/ilya-zlobintsev/LACT), a GPU monitoring and configuration tool, can now be enabled through [services.lact.enable](#opt-services.lact.enable).
Note that for LACT to work properly on AMD GPU systems, you need to enable [hardware.amdgpu.overdrive.enable](#opt-hardware.amdgpu.overdrive.enable).

Expand Down
1 change: 1 addition & 0 deletions nixos/modules/module-list.nix
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,7 @@
./programs/xfconf.nix
./programs/xfs_quota.nix
./programs/xonsh.nix
./programs/xppen.nix
./programs/xss-lock.nix
./programs/xwayland.nix
./programs/yazi.nix
Expand Down
55 changes: 55 additions & 0 deletions nixos/modules/programs/xppen.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{
config,
lib,
pkgs,
...
}:

let
cfg = config.programs.xppen;
in

{
options.programs.xppen = {
enable = lib.mkEnableOption "XPPen PenTablet application";
package = lib.mkPackageOption pkgs "xppen_4" {
example = "pkgs.xppen_3";
extraDescription = ''
Use xppen_4 for newer and xppen_3 for older tablets.
To check which version of the driver you need, go to
https://www.xp-pen.com/download/ then select your tablet
and look for the major version in the available files for Linux.
'';
};
};

config = lib.mkIf cfg.enable {
hardware.uinput.enable = true;

environment.systemPackages = [ cfg.package ];

services.udev.packages = [ cfg.package ];

systemd.tmpfiles.rules = [
"d /var/lib/pentablet/conf/xppen 0777 - - -"
];

systemd.services.xppen-create-config-dir = {
restartTriggers = [ cfg.package ];
wantedBy = [ "multi-user.target" ];
serviceConfig = {
Type = "oneshot";
TimeoutSec = 60;
ExecStart = pkgs.writeShellScript "xppen-create-config-dir" ''
readarray -d "" files < <(find ${cfg.package}/usr/lib/pentablet/conf -type f -print0)
for file in "''${files[@]}"; do
file_new="/var''${file#${cfg.package + "/usr"}}"
if [ ! -f $file_new ]; then
install -m 666 "''$file" "''$file_new"
fi
done
'';
};
};
};
}
19 changes: 19 additions & 0 deletions pkgs/applications/misc/xppen/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
callPackage,
}:

# to update: try to find the latest 3.x.x or 4.x.x .tar.gz on https://www.xp-pen.com/download
{
xppen_3 = callPackage ./generic.nix {
pname = "xppen_3";
version = "3.4.9-240607";
url = "https://www.xp-pen.com/download/file.html?id=2901&pid=819&ext=gz";
hash = "sha256-ZXeTlDjhryXamb7x2LxDdOtf8R9rgKPyUsdx96XchWM=";
};
xppen_4 = callPackage ./generic.nix {
pname = "xppen_4";
version = "4.0.7-250117";
url = "https://www.xp-pen.com/download/file.html?id=3652&pid=1211&ext=gz";
hash = "sha256-sH05Qquo2u0npSlv8Par/mn1w/ESO9g42CCGwBauHhU=";
};
}
71 changes: 71 additions & 0 deletions pkgs/applications/misc/xppen/generic.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
{
lib,
stdenv,
fetchzip,
autoPatchelfHook,
qt5,
libusb1,
pname,
version,
url,
hash,
}:

stdenv.mkDerivation {
inherit pname version;

src = fetchzip {
name = "XPPenLinux${version}.tar.gz";
extension = "tar.gz";
inherit url hash;
};

nativeBuildInputs = [
autoPatchelfHook
qt5.wrapQtAppsHook
];

buildInputs = [
qt5.qtbase
libusb1
];

dontConfigure = true;
dontBuild = true;
dontCheck = true;

installPhase = ''
runHook preInstall

rm -r App/usr/lib/pentablet/{lib,platforms,PenTablet.sh}
mkdir -p $out/{bin,usr}
cp -r App/lib $out/lib
cp -r App/usr/share $out/share
cp -r App/usr/lib $out/usr/lib

# hack: edit the binary directly
# TODO: replace it with buildFHSEnv if possible? last time it caused other issues
sed -i 's#/usr/lib/pentablet#/var/lib/pentablet#g' $out/usr/lib/pentablet/PenTablet
ln -s $out/usr/lib/pentablet/PenTablet $out/bin/PenTablet

substituteInPlace $out/share/applications/xppentablet.desktop \
--replace-fail "/usr/lib/pentablet/PenTablet.sh" "PenTablet" \
--replace-fail "/usr/share/icons/hicolor/256x256/apps/xppentablet.png" "xppentablet"

runHook postInstall
'';

meta = {
description = "XPPen driver";
downloadPage = "https://www.xp-pen.com/download/";
homepage = "https://www.xp-pen.com/";
license = lib.licenses.unfree;
mainProgram = "PenTablet";
maintainers = with lib.maintainers; [
gepbird
nasrally
];
platforms = [ "x86_64-linux" ];
sourceProvenance = [ lib.sourceTypes.binaryNativeCode ];
};
}
5 changes: 5 additions & 0 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14077,6 +14077,11 @@ with pkgs;

libxpdf = callPackage ../applications/misc/xpdf/libxpdf.nix { };

inherit (callPackage ../applications/misc/xppen { })
xppen_3
xppen_4
;

xygrib = libsForQt5.callPackage ../applications/misc/xygrib { };

ydiff = with python3.pkgs; toPythonApplication ydiff;
Expand Down
Loading