diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index 0b14b3e33018..cacb4b13f41f 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -867,6 +867,7 @@ ./services/x11/hardware/multitouch.nix ./services/x11/hardware/synaptics.nix ./services/x11/hardware/wacom.nix + ./services/x11/hardware/digimend.nix ./services/x11/hardware/cmt.nix ./services/x11/gdk-pixbuf.nix ./services/x11/redshift.nix diff --git a/nixos/modules/services/x11/hardware/digimend.nix b/nixos/modules/services/x11/hardware/digimend.nix new file mode 100644 index 000000000000..a9f5640905aa --- /dev/null +++ b/nixos/modules/services/x11/hardware/digimend.nix @@ -0,0 +1,43 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let + + cfg = config.services.xserver.digimend; + + pkg = config.boot.kernelPackages.digimend; + +in + +{ + + options = { + + services.xserver.digimend = { + + enable = mkOption { + default = false; + description = '' + Whether to enable the digimend drivers for Huion/XP-Pen/etc. tablets. + ''; + }; + + }; + + }; + + + config = mkIf cfg.enable { + + # digimend drivers use xsetwacom and wacom X11 drivers + services.xserver.wacom.enable = true; + + boot.extraModulePackages = [ pkg ]; + + environment.etc."X11/xorg.conf.d/50-digimend.conf".source = + "${pkg}/usr/share/X11/xorg.conf.d/50-digimend.conf"; + + }; + +} diff --git a/pkgs/os-specific/linux/digimend/default.nix b/pkgs/os-specific/linux/digimend/default.nix new file mode 100644 index 000000000000..40f801881fcd --- /dev/null +++ b/pkgs/os-specific/linux/digimend/default.nix @@ -0,0 +1,45 @@ +{ stdenv, fetchFromGitHub, kernel }: + +assert stdenv.lib.versionAtLeast kernel.version "3.5"; + +stdenv.mkDerivation rec { + pname = "digimend"; + version = "unstable-2019-06-18"; + + src = fetchFromGitHub { + owner = "digimend"; + repo = "digimend-kernel-drivers"; + rev = "8b228a755e44106c11f9baaadb30ce668eede5d4"; + sha256 = "1l54j85540386a8aypqka7p5hy1b63cwmpsscv9rmmf10f78v8mm"; + }; + + INSTALL_MOD_PATH = "\${out}"; + + postPatch = '' + sed 's/udevadm /true /' -i Makefile + sed 's/depmod /true /' -i Makefile + ''; + + nativeBuildInputs = kernel.moduleBuildDependencies; + + postInstall = '' + # Remove module reload hack. + # The hid-rebind unloads and then reloads the hid-* module to ensure that + # the extra/ module is loaded. + rm -r $out/lib/udev + ''; + + makeFlags = [ + "KVERSION=${kernel.modDirVersion}" + "KDIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" + "DESTDIR=${placeholder "out"}" + ]; + + meta = with stdenv.lib; { + description = "DIGImend graphics tablet drivers for the Linux kernel"; + homepage = "https://digimend.github.io/"; + license = licenses.gpl2; + maintainers = with maintainers; [ gebner ]; + platforms = platforms.linux; + }; +} diff --git a/pkgs/os-specific/linux/kmod/aggregator.nix b/pkgs/os-specific/linux/kmod/aggregator.nix index 4da87a557cbe..cd138f1d7f55 100644 --- a/pkgs/os-specific/linux/kmod/aggregator.nix +++ b/pkgs/os-specific/linux/kmod/aggregator.nix @@ -29,7 +29,7 @@ buildEnv { # kernel version number, otherwise depmod will use `uname -r'. if test -w $out/lib/modules/$kernelVersion; then rm -f $out/lib/modules/$kernelVersion/modules.!(builtin*|order*) - ${kmod}/bin/depmod -b $out -a $kernelVersion + ${kmod}/bin/depmod -b $out -C $out/etc/depmod.d -a $kernelVersion fi ''; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 69b3af91c2fb..bc97863decdc 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -16140,6 +16140,8 @@ in deepin-anything = callPackage ../os-specific/linux/deepin-anything { }; + digimend = callPackage ../os-specific/linux/digimend { }; + dpdk = callPackage ../os-specific/linux/dpdk { }; exfat-nofuse = callPackage ../os-specific/linux/exfat { };