nixos,modules: add myFlake.nixos.hardware.accessories

This commit is contained in:
Guanran Wang 2023-11-18 18:58:04 +08:00
parent b9cbe17f15
commit 5fe1d802b8
Signed by: nyancat
SSH key fingerprint: SHA256:8oWGKciPALWut/6WA27oFKofX+6Wtc0gQnsefXLQx/8
10 changed files with 71 additions and 19 deletions

View file

@ -0,0 +1,7 @@
{...}: {
imports = [
./logitech-wireless.nix
./piper.nix
./xbox-one-controller.nix
];
}

View 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;
};
};
}

View 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;
};
}

View 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
};
}

View file

@ -1,5 +1,6 @@
{...}: { {...}: {
imports = [ imports = [
./accessories
./cpu ./cpu
./gpu ./gpu
./misc ./misc

View file

@ -25,7 +25,7 @@
"nvidia-x11" "nvidia-x11"
#"nvidia-settings" #"nvidia-settings"
#"nvidia-persistenced" #"nvidia-persistenced"
#"xow_dongle-firmware" "xow_dongle-firmware"
#"facetimehd-firmware" #"facetimehd-firmware"
"osu-lazer-bin-2023.1026.0" "osu-lazer-bin-2023.1026.0"
"spotify" "spotify"

View file

@ -1,8 +0,0 @@
{...}:
# Logitech
{
hardware.logitech.wireless = {
enable = true;
enableGraphical = true;
};
}

View file

@ -1,8 +0,0 @@
{...}:
# Xbox accessories
{
hardware = {
xone.enable = true;
xpadneo.enable = true;
};
}

View file

@ -1,4 +1,10 @@
{pkgs, ...}: { {
pkgs,
lib,
...
}: {
myFlake.nixos.hardware.accessories.xboxOneController.enable = lib.mkDefault true;
programs.gamemode = { programs.gamemode = {
enable = true; enable = true;
settings.custom = { settings.custom = {

View file

@ -41,7 +41,6 @@
extraPortals = with pkgs; [xdg-desktop-portal-gtk]; extraPortals = with pkgs; [xdg-desktop-portal-gtk];
}; };
services = { services = {
ratbagd.enable = true;
gvfs.enable = true; gvfs.enable = true;
gnome = { gnome = {
sushi.enable = true; sushi.enable = true;