From fd2c7e186777df2261b39722bb9f07052aa33e2d Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Mon, 16 Feb 2026 15:22:09 +0100 Subject: [PATCH 1/3] feat(amd): add Logitech racing wheel udev rules from oversteer Co-Authored-By: Claude Opus 4.6 --- systems/x86_64-linux/amd/default.nix | 72 ++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) diff --git a/systems/x86_64-linux/amd/default.nix b/systems/x86_64-linux/amd/default.nix index 6162ee1..b874715 100644 --- a/systems/x86_64-linux/amd/default.nix +++ b/systems/x86_64-linux/amd/default.nix @@ -122,6 +122,78 @@ with lib.metacfg; services.ratbagd.enable = true; + # Logitech racing wheel permissions (oversteer) + services.udev.extraRules = '' + # Match Logitech HID devices for racing wheel support + ACTION!="unbind", ACTION!="remove", SUBSYSTEM=="hid", ATTRS{idVendor}=="046d", GOTO="logitech-rules" + GOTO="end" + + LABEL="logitech-rules" + + DRIVER=="logitech", GOTO="logitech-driver" + DRIVER!="logitech-hidpp-device", GOTO="end" + + # Logitech G PRO Racing Wheel for PlayStation and PC + ATTRS{idProduct}=="c268", RUN+="/bin/sh -c 'cd %S%p; chmod 666 range leds/*/brightness; chmod 777 leds/ leds/*'" + + # Logitech G PRO Racing Wheel for Xbox One and PC + ATTRS{idProduct}=="c272", RUN+="/bin/sh -c 'cd %S%p; chmod 666 range leds/*/brightness; chmod 777 leds/ leds/*'" + + # Logitech G923 Racing Wheel for Xbox One and PC + ATTRS{idProduct}=="c26e", RUN+="/bin/sh -c 'cd %S%p; chmod 666 range leds/*/brightness; chmod 777 leds/ leds/*'" + + # Logitech G920 Driving Force Racing Wheel + ATTRS{idProduct}=="c262", RUN+="/bin/sh -c 'cd %S%p; chmod 666 range'" + + GOTO="end" + + LABEL="logitech-driver" + + # Logitech G923 Racing Wheel for PlayStation 4 and PC + ATTRS{idProduct}=="c266", RUN+="/bin/sh -c 'cd %S%p; chmod 666 alternate_modes combine_pedals range gain autocenter spring_level damper_level friction_level ffb_leds peak_ffb_level leds/*/brightness; chmod 777 leds/ leds/*'" + + # Logitech G29 Driving Force Racing Wheel + ATTRS{idProduct}=="c24f", RUN+="/bin/sh -c 'cd %S%p; chmod 666 alternate_modes combine_pedals range gain autocenter spring_level damper_level friction_level ffb_leds peak_ffb_level leds/*/brightness; chmod 777 leds/ leds/*'" + + # Logitech G27 Driving Force Racing Wheel + ATTRS{idProduct}=="c29b", RUN+="/bin/sh -c 'cd %S%p; chmod 666 alternate_modes combine_pedals range gain autocenter spring_level damper_level friction_level ffb_leds peak_ffb_level leds/*/brightness; chmod 777 leds/ leds/*'" + + # Logitech G25 Driving Force Racing Wheel + ATTRS{idProduct}=="c299", RUN+="/bin/sh -c 'cd %S%p; chmod 666 alternate_modes combine_pedals range gain autocenter spring_level damper_level friction_level ffb_leds peak_ffb_level'" + + # Logitech Driving Force GT Racing Wheel + ATTRS{idProduct}=="c29a", RUN+="/bin/sh -c 'cd %S%p; chmod 666 alternate_modes combine_pedals range gain autocenter spring_level damper_level friction_level ffb_leds peak_ffb_level'" + + # Logitech Driving Force Pro Racing Wheel + ATTRS{idProduct}=="c298", RUN+="/bin/sh -c 'cd %S%p; chmod 666 alternate_modes combine_pedals range gain autocenter spring_level damper_level friction_level ffb_leds peak_ffb_level'" + + # Logitech Driving Force Racing Wheel + ATTRS{idProduct}=="c294", RUN+="/bin/sh -c 'cd %S%p; chmod 666 alternate_modes combine_pedals range gain autocenter spring_level damper_level friction_level ffb_leds peak_ffb_level'" + + # Logitech Momo Force Racing Wheel + ATTRS{idProduct}=="c295", RUN+="/bin/sh -c 'cd %S%p; chmod 666 combine_pedals range gain autocenter spring_level damper_level friction_level ffb_leds peak_ffb_level'" + + # Logitech MOMO Racing USB + ATTRS{idProduct}=="ca03", RUN+="/bin/sh -c 'cd %S%p; chmod 666 combine_pedals range gain autocenter spring_level damper_level friction_level ffb_leds peak_ffb_level'" + + # Logitech WingMan Formula Force GP USB + ATTRS{idProduct}=="c293", RUN+="/bin/sh -c 'cd %S%p; chmod 666 combine_pedals range gain autocenter spring_level damper_level friction_level ffb_leds peak_ffb_level'" + + # Logitech Racing Wheel USB + ATTRS{idProduct}=="ca04", RUN+="/bin/sh -c 'cd %S%p; chmod 666 combine_pedals range'" + + # Logitech WingMan Formula GP + ATTRS{idProduct}=="c20e", RUN+="/bin/sh -c 'cd %S%p; chmod 666 combine_pedals range'" + + # Logitech WingMan Formula (Yellow) (USB) + ATTRS{idProduct}=="c202", RUN+="/bin/sh -c 'cd %S%p; chmod 666 range'" + + # Logitech Speed Force Wireless + ATTRS{idProduct}=="c29c", RUN+="/bin/sh -c 'cd %S%p; chmod 666 combine_pedals range'" + + LABEL="end" + ''; + virtualisation = { libvirtd.enable = true; docker.enable = true; From 00f66d7fd808c10dade82849acb6298b9dea89ef Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Mon, 16 Feb 2026 15:24:53 +0100 Subject: [PATCH 2/3] feat(amd): add oversteer --- systems/x86_64-linux/amd/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/systems/x86_64-linux/amd/default.nix b/systems/x86_64-linux/amd/default.nix index b874715..c46fe29 100644 --- a/systems/x86_64-linux/amd/default.nix +++ b/systems/x86_64-linux/amd/default.nix @@ -112,6 +112,7 @@ with lib.metacfg; vscode cider-2 opencode + oversteer ]; # zram swap with zstd compression for better performance From b85719077d59749428f21390ab85521946269d3a Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Tue, 17 Feb 2026 10:40:15 +0100 Subject: [PATCH 3/3] feat(nix): add ROCm runtime patches for gfx1151 - Added two patches to the ROCm runtime: `rocr-runtime-gfx1151-vgpr.patch` and `rocr-runtime-kernel-stack-size.patch`. - Fixes compatibility issues, ensures better kernel support, and mitigates potential crashes on older kernels. --- flake.nix | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/flake.nix b/flake.nix index 3456e24..062c997 100644 --- a/flake.nix +++ b/flake.nix @@ -96,6 +96,39 @@ allowUnfree = true; }; + channels.unstable.overlays = [ + (final: prev: { + rocm-runtime = prev.rocm-runtime.overrideAttrs (prevAttrs: { + patches = (prevAttrs.patches or [ ]) ++ [ + (final.fetchpatch { + # [PATCH] hsakmt: bump vgpr count for gfx1151 (#1807) (#1986) + # We apply only the change that adds a GFX_VERSION_GFX1151 define but + # *not* the default vgpr change which causes crashes on old kernels + # This was later partially reverted in # [PATCH] Revert "hsakmt: bump vgpr count for gfx1151 (#1807) (#1986)" + name = "rocr-runtime-gfx1151-vgpr.patch"; + url = "https://github.com/ROCm/rocm-systems/commit/09ba45b3f43ec333a84a0ca178fcd1e3ea9400a9.patch"; + relative = "projects/rocr-runtime"; + includes = [ "libhsakmt/src/libhsakmt.h" ]; + hash = "sha256-/V5i+sr88n7fK4yNjR/FpY0ZpiEG5xAD6Oq+9ZOikd4="; + }) + (final.fetchpatch { + # [PATCH] hsakmt: Expose and use CWSR and Control stack sizes (#2200) + # Fixes potential mismatches between stack sizes configured in amdgpu kernel module + # and userspace by relying on kernel value when available + # Falls back to hardcoded size based on ISA if kernel is too old. For gfx1151, also prints: + # WARNING: KFD ABI 1.20+ is recommended … This may result in faults, crashes and other application instability + # This allows new kernels to work with this runtime detection mechanism + # Only gfx1151 warns loudly because only it has had the size updated in kernel… + name = "rocr-runtime-kernel-stack-size.patch"; + url = "https://github.com/ROCm/rocm-systems/commit/7037a71f311c021974fafd13727dfefd8a1cc79d.patch"; + relative = "projects/rocr-runtime"; + hash = "sha256-EbDxuEvNu0fyQJZmqq0fbcCdNtaEWUbmyPLvcfqDPjc="; + }) + ]; + }); + }) + ]; + homes.modules = with inputs; [ neovim-flake.homeManagerModules.default ]; systems.modules.nixos = with inputs; [