1
0
Fork 0

Compare commits

..

No commits in common. "3f8c3d8326b18dc07f5277105134cbb03c36407d" and "e61b7af405e83e7896492a0b19a42d420aab5471" have entirely different histories.

3 changed files with 42 additions and 10 deletions

View file

@ -267,11 +267,11 @@
},
"nixos-hardware": {
"locked": {
"lastModified": 1730919458,
"narHash": "sha256-yMO0T0QJlmT/x4HEyvrCyigGrdYfIXX3e5gWqB64wLg=",
"lastModified": 1730828750,
"narHash": "sha256-XrnZLkLiBYNlwV5gus/8DT7nncF1TS5la6Be7rdVOpI=",
"owner": "NixOS",
"repo": "nixos-hardware",
"rev": "e1cc1f6483393634aee94514186d21a4871e78d7",
"rev": "2e78b1af8025108ecd6edaa3ab09695b8a4d3d55",
"type": "github"
},
"original": {
@ -315,11 +315,11 @@
},
"nixpkgs-unstable": {
"locked": {
"lastModified": 1730785428,
"narHash": "sha256-Zwl8YgTVJTEum+L+0zVAWvXAGbWAuXHax3KzuejaDyo=",
"lastModified": 1730531603,
"narHash": "sha256-Dqg6si5CqIzm87sp57j5nTaeBbWhHFaVyG7V6L8k3lY=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "4aa36568d413aca0ea84a1684d2d46f55dbabad7",
"rev": "7ffd9ae656aec493492b44d0ddfb28e79a1ea25d",
"type": "github"
},
"original": {
@ -331,11 +331,11 @@
},
"nixpkgs_2": {
"locked": {
"lastModified": 1730883749,
"narHash": "sha256-mwrFF0vElHJP8X3pFCByJR365Q2463ATp2qGIrDUdlE=",
"lastModified": 1730741070,
"narHash": "sha256-edm8WG19kWozJ/GqyYx2VjW99EdhjKwbY3ZwdlPAAlo=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "dba414932936fde69f0606b4f1d87c5bc0003ede",
"rev": "d063c1dd113c91ab27959ba540c0d9753409edf3",
"type": "github"
},
"original": {

View file

@ -9,7 +9,8 @@ in
# Configure the kernel.
boot = {
kernelPackages = pkgs.linuxPackages_latest;
# First, install the latest Zen kernel
kernelPackages = pkgs.linuxPackages_zen;
# Hardware defaults detected by nixos-generate-configuration
initrd = {

View file

@ -13,6 +13,13 @@ let
sudo rmmod hid_xpadneo && sudo modprobe hid_xpadneo
sudo systemctl restart bluetooth.service
'';
# vendorID and product ID for Victrix Pro BFG controller
vendorID = "0e6f";
productID = "024b";
# Bluetooth config for Victrix PDP pro
vitrix-pdp-pro-bluetooth = pkgs.writeText "info" (builtins.readFile ./bluetooth/vitrix-pdp-pro);
in
{
options = {
@ -32,6 +39,30 @@ in
# Enable Xbox controller driver (XPadNeo)
hardware.xpadneo.enable = true;
systemd.tmpfiles.rules = lib.mkIf config.aux.system.bluetooth.enable [
"d /var/lib/bluetooth/${config.aux.system.bluetooth.adapter}/ 0700 root root" # First, make sure the directory exists
"L+ /var/lib/bluetooth/${config.aux.system.bluetooth.adapter}/00:34:30:47:37:AB/info - - - - ${vitrix-pdp-pro-bluetooth}"
];
# Create udev rule to force PDP Victrix controller to use xpadneo
# Udev rule taken from https://github.com/atar-axis/xpadneo/blob/master/hid-xpadneo/etc-udev-rules.d/60-xpadneo.rules
# Also see https://www.reddit.com/r/linuxquestions/comments/rcx182/why_cant_i_write_to_sysbushiddriversxpadneonew_id/
services.udev.extraRules = ''
ACTION=="add", ATTRS{id/vendor}==${vendorID}, ATTRS{id/product}==${productID}, RUN+="${pkgs.bash}/bin/bash -c 'echo 0x03 ${vendorID} ${productID} > /sys/bus/hid/drivers/xpadneo/new_id && echo 0x05 ${vendorID} ${productID} > /sys/bus/hid/drivers/xpadneo/new_id'"
'';
/*
services.udev.packages = [
(pkgs.writeTextFile {
name = "victrix-pro-bfg.rules";
executable = true;
destination = "/etc/udev/rules.d/70-victrix-pro-bfg.rules";
text = ''
ACTION=="add", ATTRS{id/vendor}==${vendorID}, ATTRS{id/product}==${productID}, RUN+="${pkgs.bash}/bin/bash -c 'echo 0x03 ${vendorID} ${productID} > /sys/bus/hid/drivers/xpadneo/new_id && echo 0x05 ${vendorID} ${productID} > /sys/bus/hid/drivers/xpadneo/new_id'"
'';
})
];
*/
# Add script to restart xpadneo in case of issues
aux.system.packages = [ reset-controllers-script ];