forked from mirrors/nixpkgs
Merge pull request #161008 from rhysmdnz/xone
xone: init package and module
This commit is contained in:
commit
79862ae905
|
@ -10276,6 +10276,13 @@
|
|||
githubId = 6047658;
|
||||
name = "Ryan Horiguchi";
|
||||
};
|
||||
rhysmdnz = {
|
||||
email = "rhys@memes.nz";
|
||||
matrix = "@rhys:memes.nz";
|
||||
github = "rhysmdnz";
|
||||
githubId = 2162021;
|
||||
name = "Rhys Davies";
|
||||
};
|
||||
ribose-jeffreylau = {
|
||||
name = "Jeffrey Lau";
|
||||
email = "jeffrey.lau@ribose.com";
|
||||
|
|
|
@ -83,6 +83,7 @@ in {
|
|||
b43Firmware_5_1_138
|
||||
b43Firmware_6_30_163_46
|
||||
b43FirmwareCutter
|
||||
xow_dongle-firmware
|
||||
] ++ optional pkgs.stdenv.hostPlatform.isx86 facetimehd-firmware;
|
||||
})
|
||||
(mkIf cfg.wirelessRegulatoryDatabase {
|
||||
|
|
23
nixos/modules/hardware/xone.nix
Normal file
23
nixos/modules/hardware/xone.nix
Normal file
|
@ -0,0 +1,23 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.hardware.xone;
|
||||
in
|
||||
{
|
||||
options.hardware.xone = {
|
||||
enable = mkEnableOption "the xone driver for Xbox One and Xbobx Series X|S accessories";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
boot = {
|
||||
blacklistedKernelModules = [ "xpad" "mt76x2u" ];
|
||||
extraModulePackages = with config.boot.kernelPackages; [ xone ];
|
||||
};
|
||||
hardware.firmware = [ pkgs.xow_dongle-firmware ];
|
||||
};
|
||||
|
||||
meta = {
|
||||
maintainers = with maintainers; [ rhysmdnz ];
|
||||
};
|
||||
}
|
|
@ -91,6 +91,7 @@
|
|||
./hardware/video/switcheroo-control.nix
|
||||
./hardware/video/uvcvideo/default.nix
|
||||
./hardware/video/webcam/facetimehd.nix
|
||||
./hardware/xone.nix
|
||||
./hardware/xpadneo.nix
|
||||
./i18n/input-method/default.nix
|
||||
./i18n/input-method/fcitx.nix
|
||||
|
|
|
@ -0,0 +1,32 @@
|
|||
{ stdenv, lib, fetchurl, cabextract }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "xow_dongle-firmware";
|
||||
version = "2017-07";
|
||||
|
||||
dontUnpack = true;
|
||||
dontInstall = true;
|
||||
|
||||
src = fetchurl {
|
||||
url = "http://download.windowsupdate.com/c/msdownload/update/driver/drvs/2017/07/1cd6a87c-623f-4407-a52d-c31be49e925c_e19f60808bdcbfbd3c3df6be3e71ffc52e43261e.cab";
|
||||
sha256 = "013g1zngxffavqrk5jy934q3bdhsv6z05ilfixdn8dj0zy26lwv5";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ cabextract ];
|
||||
|
||||
buildPhase = ''
|
||||
cabextract -F FW_ACC_00U.bin ${src}
|
||||
mkdir -p $out/lib/firmware
|
||||
cp -a FW_ACC_00U.bin $out/lib/firmware/xow_dongle.bin
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "Xbox One wireless dongle firmware";
|
||||
homepage = "https://www.xbox.com/en-NZ/accessories/adapters/wireless-adapter-windows";
|
||||
license = licenses.unfree;
|
||||
maintainers = with lib.maintainers; [ rhysmdnz ];
|
||||
platforms = platforms.linux;
|
||||
};
|
||||
}
|
||||
|
||||
|
39
pkgs/os-specific/linux/xone/default.nix
Normal file
39
pkgs/os-specific/linux/xone/default.nix
Normal file
|
@ -0,0 +1,39 @@
|
|||
{ stdenv, lib, fetchFromGitHub, kernel, fetchurl }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
name = "xone-${version}-${kernel.version}";
|
||||
version = "0.2";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "medusalix";
|
||||
repo = "xone";
|
||||
rev = "v${version}";
|
||||
sha256 = "sha256-m4305Xl5w4nyAVqubjwWsiyPDVtfGykjlSW2eKEytVk=";
|
||||
};
|
||||
|
||||
setSourceRoot = ''
|
||||
export sourceRoot=$(pwd)/source
|
||||
'';
|
||||
|
||||
nativeBuildInputs = kernel.moduleBuildDependencies;
|
||||
|
||||
makeFlags = [
|
||||
"-C"
|
||||
"${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
|
||||
"M=$(sourceRoot)"
|
||||
"VERSION=${version}"
|
||||
];
|
||||
|
||||
buildFlags = [ "modules" ];
|
||||
installFlags = [ "INSTALL_MOD_PATH=${placeholder "out"}" ];
|
||||
installTargets = [ "modules_install" ];
|
||||
|
||||
meta = with lib; {
|
||||
description = "Linux kernel driver for Xbox One and Xbox Series X|S accessories";
|
||||
homepage = "https://github.com/medusalix/xone";
|
||||
license = licenses.gpl2;
|
||||
maintainers = with lib.maintainers; [ rhysmdnz ];
|
||||
platforms = platforms.linux;
|
||||
};
|
||||
}
|
||||
|
|
@ -34197,6 +34197,8 @@ with pkgs;
|
|||
|
||||
xosview2 = callPackage ../tools/X11/xosview2 { };
|
||||
|
||||
xow_dongle-firmware = callPackage ../os-specific/linux/firmware/xow_dongle-firmware { };
|
||||
|
||||
xpad = callPackage ../applications/misc/xpad { };
|
||||
|
||||
xsane = callPackage ../applications/graphics/sane/xsane.nix {
|
||||
|
|
|
@ -462,6 +462,8 @@ in {
|
|||
|
||||
xmm7360-pci = callPackage ../os-specific/linux/xmm7360-pci { };
|
||||
|
||||
xone = if lib.versionAtLeast kernel.version "5.4" then callPackage ../os-specific/linux/xone { } else null;
|
||||
|
||||
xpadneo = callPackage ../os-specific/linux/xpadneo { };
|
||||
|
||||
zenpower = callPackage ../os-specific/linux/zenpower { };
|
||||
|
|
Loading…
Reference in a new issue