nixos,modules: add myFlake.nixos.hardware.accessories
This commit is contained in:
parent
b9cbe17f15
commit
5fe1d802b8
10 changed files with 71 additions and 19 deletions
7
nixos/modules/hardware/accessories/default.nix
Normal file
7
nixos/modules/hardware/accessories/default.nix
Normal file
|
@ -0,0 +1,7 @@
|
|||
{...}: {
|
||||
imports = [
|
||||
./logitech-wireless.nix
|
||||
./piper.nix
|
||||
./xbox-one-controller.nix
|
||||
];
|
||||
}
|
19
nixos/modules/hardware/accessories/logitech-wireless.nix
Normal file
19
nixos/modules/hardware/accessories/logitech-wireless.nix
Normal file
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}: let
|
||||
cfg = config.myFlake.nixos.hardware.accessories.logitech-wireless;
|
||||
in {
|
||||
options = {
|
||||
myFlake.nixos.hardware.accessories.logitech-wireless.enable =
|
||||
lib.mkEnableOption "Whether to enable support for wireless Logitech hardwares.";
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
hardware.logitech.wireless = {
|
||||
enable = true;
|
||||
enableGraphical = true;
|
||||
};
|
||||
};
|
||||
}
|
18
nixos/modules/hardware/accessories/piper.nix
Normal file
18
nixos/modules/hardware/accessories/piper.nix
Normal file
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
cfg = config.myFlake.nixos.hardware.accessories.piper;
|
||||
in {
|
||||
options = {
|
||||
myFlake.nixos.hardware.accessories.piper.enable =
|
||||
lib.mkEnableOption "Whether to enable Piper.";
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
environment.systemPackages = [pkgs.piper];
|
||||
services.ratbagd.enable = true;
|
||||
};
|
||||
}
|
18
nixos/modules/hardware/accessories/xbox-one-controller.nix
Normal file
18
nixos/modules/hardware/accessories/xbox-one-controller.nix
Normal file
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}: let
|
||||
cfg = config.myFlake.nixos.hardware.accessories.xboxOneController;
|
||||
in {
|
||||
options = {
|
||||
myFlake.nixos.hardware.accessories.xboxOneController.enable =
|
||||
lib.mkEnableOption "Whether to enable support for Xbox One controllers.";
|
||||
};
|
||||
|
||||
# https://wiki.archlinux.org/title/Gamepad#Connect_Xbox_Wireless_Controller_with_Bluetooth
|
||||
config = lib.mkIf cfg.enable {
|
||||
hardware.xone.enable = true; # via Bluetooth
|
||||
hardware.xpadneo.enable = true; # via wired or wireless dongle
|
||||
};
|
||||
}
|
|
@ -1,5 +1,6 @@
|
|||
{...}: {
|
||||
imports = [
|
||||
./accessories
|
||||
./cpu
|
||||
./gpu
|
||||
./misc
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
"nvidia-x11"
|
||||
#"nvidia-settings"
|
||||
#"nvidia-persistenced"
|
||||
#"xow_dongle-firmware"
|
||||
"xow_dongle-firmware"
|
||||
#"facetimehd-firmware"
|
||||
"osu-lazer-bin-2023.1026.0"
|
||||
"spotify"
|
||||
|
|
|
@ -1,8 +0,0 @@
|
|||
{...}:
|
||||
# Logitech
|
||||
{
|
||||
hardware.logitech.wireless = {
|
||||
enable = true;
|
||||
enableGraphical = true;
|
||||
};
|
||||
}
|
|
@ -1,8 +0,0 @@
|
|||
{...}:
|
||||
# Xbox accessories
|
||||
{
|
||||
hardware = {
|
||||
xone.enable = true;
|
||||
xpadneo.enable = true;
|
||||
};
|
||||
}
|
|
@ -1,4 +1,10 @@
|
|||
{pkgs, ...}: {
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
myFlake.nixos.hardware.accessories.xboxOneController.enable = lib.mkDefault true;
|
||||
|
||||
programs.gamemode = {
|
||||
enable = true;
|
||||
settings.custom = {
|
||||
|
|
|
@ -41,7 +41,6 @@
|
|||
extraPortals = with pkgs; [xdg-desktop-portal-gtk];
|
||||
};
|
||||
services = {
|
||||
ratbagd.enable = true;
|
||||
gvfs.enable = true;
|
||||
gnome = {
|
||||
sushi.enable = true;
|
||||
|
|
Loading…
Reference in a new issue