Unverified Commit 4aafbc10 authored by Pol Dellaiera's avatar Pol Dellaiera Committed by GitHub
Browse files

xppen_{3,4}: init at {3.4.9-240607,4.0.7-250117}; nixos/xppen: init (#351647)

parents c16d94e2 c29545ba
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -18061,6 +18061,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;
+2 −0
Original line number Diff line number Diff line
@@ -49,6 +49,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).

+1 −0
Original line number Diff line number Diff line
@@ -362,6 +362,7 @@
  ./programs/xfconf.nix
  ./programs/xfs_quota.nix
  ./programs/xonsh.nix
  ./programs/xppen.nix
  ./programs/xss-lock.nix
  ./programs/xwayland.nix
  ./programs/yazi.nix
+55 −0
Original line number Diff line number Diff line
{
  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 −0
Original line number Diff line number Diff line
{
  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=";
  };
}
Loading