diff --git a/modules/nixos/workstation/gaming/default.nix b/modules/nixos/workstation/gaming/default.nix index c98c43e..b415fc7 100644 --- a/modules/nixos/workstation/gaming/default.nix +++ b/modules/nixos/workstation/gaming/default.nix @@ -3,5 +3,6 @@ ./steam.nix ./gamemode.nix ./switch.nix + ./emulation.nix ]; } diff --git a/modules/nixos/workstation/gaming/emulation.nix b/modules/nixos/workstation/gaming/emulation.nix new file mode 100644 index 0000000..f4c3f30 --- /dev/null +++ b/modules/nixos/workstation/gaming/emulation.nix @@ -0,0 +1,32 @@ +{ + lib, + config, + pkgs, + ... +}: let + inherit (lib) mkIf elem; + inherit (config.ooknet.workstation) profiles; +in { + config = mkIf (elem "gaming" profiles) { + services.udev.packages = [ + pkgs.dolphin-emu + (pkgs.writeTextFile { + name = "99-nintendo-controller.rules"; + text = '' + SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", \ + ATTRS{idVendor}=="057e", ATTRS{idProduct}=="0337", \ + MODE="0666"; + ''; + destination = "/etc/udev/rules.d/40-nintendo-controller.rules"; + }) + ]; + boot.extraModulePackages = [ + config.boot.kernelPackages.gcadapter-oc-kmod + ]; + + # to autoload at boot: + boot.kernelModules = [ + "gcadapter_oc" + ]; + }; +}