main
 1{
 2  flake-file.inputs.nix-gaming = {
 3    url = "github:fufexan/nix-gaming";
 4    inputs.nixpkgs.follows = "nixpkgs";
 5  };
 6
 7  flake.modules.nixos.game = {pkgs, ...}: let
 8    # Fix DualSense haptics until https://github.com/alsa-project/alsa-ucm-conf/issues/677 been resolved.
 9    patched-alsa-ucm-conf = pkgs.alsa-ucm-conf.overrideAttrs (oldAttrs: {
10      postInstall =
11        (oldAttrs.postInstall or "")
12        + ''
13          echo 'Error "UCM support temporary disabled for ''${CardLongName}"' >> $out/share/alsa/ucm2/USB-Audio/Sony/DualSense-PS5.conf
14        '';
15    });
16  in {
17    system.replaceDependencies.replacements = [
18      {
19        oldDependency = pkgs.alsa-ucm-conf;
20        newDependency = patched-alsa-ucm-conf;
21      }
22    ];
23  };
24}