1
0
Fork 0
nix-configuration/modules/nixos/apps/gaming/default.nix

45 lines
951 B
Nix
Raw Normal View History

{
config,
lib,
pkgs,
2024-12-06 18:04:47 +00:00
namespace,
...
}:
2024-02-29 14:53:34 +00:00
# Gaming-related settings
let
2024-12-06 18:04:47 +00:00
cfg = config.${namespace}.apps.gaming;
2024-05-12 00:29:29 +00:00
reset-controllers-script = pkgs.writeShellScriptBin "reset-controllers" ''
#!/usr/bin/env bash
sudo rmmod hid_xpadneo && sudo modprobe hid_xpadneo
sudo systemctl restart bluetooth.service
'';
2024-02-29 14:53:34 +00:00
in
{
options = {
2024-12-06 18:04:47 +00:00
${namespace}.apps.gaming.enable = lib.mkEnableOption "Enables gaming features";
};
2024-02-29 14:53:34 +00:00
2024-08-02 21:55:48 +00:00
config = lib.mkIf cfg.enable {
2024-12-06 18:04:47 +00:00
${namespace} = {
# Add script to restart xpadneo in case of issues
packages = [ reset-controllers-script ];
ui.flatpak = {
enable = true;
packages = [
"gg.minion.Minion"
"com.valvesoftware.Steam"
"org.firestormviewer.FirestormViewer"
];
};
2024-06-25 18:13:15 +00:00
};
2024-03-11 16:27:30 +00:00
# Enable Xbox controller driver (XPadNeo)
2024-06-05 17:42:14 +00:00
hardware.xpadneo.enable = true;
2024-05-12 00:29:29 +00:00
2024-07-31 18:20:28 +00:00
# Enable GameMode
programs.gamemode.enable = true;
};
2024-02-29 14:53:34 +00:00
}