PortValhalla/lib/modules/hardware.nix

76 lines
2 KiB
Nix
Raw Normal View History

2024-10-13 23:55:19 +00:00
{ config, lib, ... }:
let
inherit (lib) mkOption types;
optionalAttrs = lib.attrsets.optionalAttrs;
hw = config.valhalla.hardware;
2024-10-06 19:25:34 +00:00
in {
options = {
valhalla = {
hardware = {
components = mkOption {
type = types.listOf types.str;
description = "The names of the hardware components of the computer.";
default = [ ];
};
2024-08-06 15:23:20 +00:00
2024-10-06 19:25:34 +00:00
surfaceBook = mkOption {
type = types.bool;
description = "A value indicating whether the system is a Surface Book 2.";
default = false;
};
2024-09-20 00:01:22 +00:00
2024-10-06 19:25:34 +00:00
xoneReceiver = mkOption {
type = types.bool;
description = "A value indicating whether an Xbox receiver is present.";
default = false;
};
2024-09-20 00:01:22 +00:00
2024-10-06 19:25:34 +00:00
eyeX = mkOption {
type = types.bool;
description = "A value indicating whether a Tobii EyeX device is present.";
default = false;
};
2024-08-06 15:23:20 +00:00
2024-10-06 19:25:34 +00:00
amdCPU = mkOption {
type = types.bool;
description = "A value indicating whether an AMD CPU is present.";
default = false;
};
2024-08-06 15:23:20 +00:00
2024-10-06 19:25:34 +00:00
nvidiaGPU = mkOption {
type = types.bool;
description = "A value indicating whether an NVIDIA GPU is present.";
default = false;
};
2024-08-06 15:23:20 +00:00
2024-10-06 19:25:34 +00:00
corsairDevice = mkOption {
type = types.bool;
description = "A value indicating whether a Corsair device is present.";
default = false;
};
2024-08-07 23:51:21 +00:00
2024-10-06 19:25:34 +00:00
elgatoWave = mkOption {
type = types.bool;
description = "A value indicating whether an Elgato Wave device is present.";
default = false;
};
2024-08-06 15:23:20 +00:00
};
};
2024-10-06 19:25:34 +00:00
};
2024-10-13 23:55:19 +00:00
config = {
valhalla = {
linux.programs = (optionalAttrs hw.nvidiaGPU {
nvidia-dkms.enable = true;
}) // (optionalAttrs hw.xoneReceiver {
xone.enable = true;
});
windows.programs = (optionalAttrs hw.eyeX {
tobii-gamehub.enable = lib.mkDefault true;
tobii-ghost.enable = lib.mkDefault true;
});
};
};
2024-10-06 19:25:34 +00:00
}