1
0
Fork 0

Compare commits

...

3 commits

3 changed files with 33 additions and 10 deletions

View file

@ -267,16 +267,16 @@
}, },
"nixos-hardware": { "nixos-hardware": {
"locked": { "locked": {
"lastModified": 1729143336, "lastModified": 1729802774,
"narHash": "sha256-0RtqGBSp9PYpQg/+ZOgJ79ypUt/Sf1dv/ym/xMmyaE0=", "narHash": "sha256-pssdzH1vOnTWvoGwfy3OfqY2oA6tKAHLGJFm5FeXYCI=",
"owner": "mexisme", "owner": "8bitbuddhist",
"repo": "nixos-hardware", "repo": "nixos-hardware",
"rev": "5871b0a32ec6bc9420795dcede8c644a5fe0d85d", "rev": "52323ec811f4c94b2f32ba1c83d86f0594977dc8",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "mexisme", "owner": "8bitbuddhist",
"ref": "ms-surface/update-kernel-6.10.10", "ref": "ms-surface/update-kernel-6.11.4",
"repo": "nixos-hardware", "repo": "nixos-hardware",
"type": "github" "type": "github"
} }
@ -331,11 +331,11 @@
}, },
"nixpkgs_2": { "nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1729449015, "lastModified": 1729691686,
"narHash": "sha256-Gf04dXB0n4q0A9G5nTGH3zuMGr6jtJppqdeljxua1fo=", "narHash": "sha256-BAuPWW+9fa1moZTU+jFh+1cUtmsuF8asgzFwejM4wac=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "89172919243df199fe237ba0f776c3e3e3d72367", "rev": "32e940c7c420600ef0d1ef396dc63b04ee9cad37",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -42,7 +42,7 @@
# NixOS hardware quirks # NixOS hardware quirks
#nixos-hardware.url = "github:NixOS/nixos-hardware/master"; #nixos-hardware.url = "github:NixOS/nixos-hardware/master";
nixos-hardware.url = "github:mexisme/nixos-hardware?ref=ms-surface/update-kernel-6.10.10"; nixos-hardware.url = "github:8bitbuddhist/nixos-hardware?ref=ms-surface/update-kernel-6.11.4";
}; };
outputs = outputs =

View file

@ -13,6 +13,10 @@ let
sudo rmmod hid_xpadneo && sudo modprobe hid_xpadneo sudo rmmod hid_xpadneo && sudo modprobe hid_xpadneo
sudo systemctl restart bluetooth.service sudo systemctl restart bluetooth.service
''; '';
# FIXME: replace with real vendorID and product ID for Victrix Pro BFG controller
vendorID = "0e6f";
productID = "024b";
in in
{ {
options = { options = {
@ -32,6 +36,25 @@ in
# Enable Xbox controller driver (XPadNeo) # Enable Xbox controller driver (XPadNeo)
hardware.xpadneo.enable = true; hardware.xpadneo.enable = true;
# 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 # Add script to restart xpadneo in case of issues
aux.system.packages = [ reset-controllers-script ]; aux.system.packages = [ reset-controllers-script ];