diff options
author | Silvan Mosberger <contact@infinisil.com> | 2019-09-03 19:14:58 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-03 19:14:58 +0200 |
commit | ce944b4bdedcd8619b75989b79188f26a16a2b5f (patch) | |
tree | bfafc7d7f54f7acdf3b22e5894f24d4397ee615a /pkgs/os-specific | |
parent | 26b8a0a940fabfe58e6c204678ac96f18d1e1043 (diff) | |
parent | e9b167bef4a76d0d5ae262e19d79fee360b8ebd5 (diff) |
Merge pull request #64552 from evanjs/feature/openrazer-2.3.1
openrazer: init at 2.6.0
Diffstat (limited to 'pkgs/os-specific')
-rw-r--r-- | pkgs/os-specific/linux/openrazer/driver.nix | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/pkgs/os-specific/linux/openrazer/driver.nix b/pkgs/os-specific/linux/openrazer/driver.nix new file mode 100644 index 000000000000..355108f56e46 --- /dev/null +++ b/pkgs/os-specific/linux/openrazer/driver.nix @@ -0,0 +1,39 @@ +{ coreutils +, fetchFromGitHub +, kernel +, stdenv +, utillinux +}: + +let + common = import ../../../development/python-modules/openrazer/common.nix { inherit stdenv fetchFromGitHub; }; +in +stdenv.mkDerivation (common // { + name = "openrazer-${common.version}-${kernel.version}"; + + nativeBuildInputs = kernel.moduleBuildDependencies; + + buildFlags = [ + "KERNELDIR=${kernel.dev}/lib/modules/${kernel.version}/build" + ]; + + installPhase = '' + binDir="$out/lib/modules/${kernel.modDirVersion}/kernel/drivers/hid" + mkdir -p "$binDir" + cp -v driver/*.ko "$binDir" + RAZER_MOUNT_OUT="$out/bin/razer_mount" + RAZER_RULES_OUT="$out/etc/udev/rules.d/99-razer.rules" + install -m 644 -v -D install_files/udev/99-razer.rules $RAZER_RULES_OUT + install -m 755 -v -D install_files/udev/razer_mount $RAZER_MOUNT_OUT + substituteInPlace $RAZER_RULES_OUT \ + --replace razer_mount $RAZER_MOUNT_OUT + substituteInPlace $RAZER_MOUNT_OUT \ + --replace /usr/bin/logger ${utillinux}/bin/logger \ + --replace chgrp ${coreutils}/bin/chgrp \ + --replace "PATH='/sbin:/bin:/usr/sbin:/usr/bin'" "" + ''; + + meta = common.meta // { + description = "An entirely open source Linux driver that allows you to manage your Razer peripherals on GNU/Linux"; + }; +}) |