summary refs log tree commit diff
path: root/nixos/modules/services/hardware
diff options
context:
space:
mode:
authorJörg Thalheim <joerg@thalheim.io>2023-09-03 07:13:40 +0200
committerJörg Thalheim <joerg@thalheim.io>2023-09-03 07:16:52 +0200
commitf6fa02c984f46a7157e72feab59608662d740d3a (patch)
tree22d46f2fe50aec4129533644d620eae6f426d8a8 /nixos/modules/services/hardware
parentd816b5ab44187a2dd84806630ce77a733724f95f (diff)
downloadnixpkgs-f6fa02c984f46a7157e72feab59608662d740d3a.tar
nixpkgs-f6fa02c984f46a7157e72feab59608662d740d3a.tar.gz
nixpkgs-f6fa02c984f46a7157e72feab59608662d740d3a.tar.bz2
nixpkgs-f6fa02c984f46a7157e72feab59608662d740d3a.tar.lz
nixpkgs-f6fa02c984f46a7157e72feab59608662d740d3a.tar.xz
nixpkgs-f6fa02c984f46a7157e72feab59608662d740d3a.tar.zst
nixpkgs-f6fa02c984f46a7157e72feab59608662d740d3a.zip
openrbg: set default based on what microcode updates are enabled
nixos-generate-config sets either of these, so lets use them
Diffstat (limited to 'nixos/modules/services/hardware')
-rw-r--r--nixos/modules/services/hardware/openrgb.nix9
1 files changed, 8 insertions, 1 deletions
diff --git a/nixos/modules/services/hardware/openrgb.nix b/nixos/modules/services/hardware/openrgb.nix
index 310615ecc53..13b1d07e53b 100644
--- a/nixos/modules/services/hardware/openrgb.nix
+++ b/nixos/modules/services/hardware/openrgb.nix
@@ -17,7 +17,14 @@ in {
 
     motherboard = mkOption {
       type = types.nullOr (types.enum [ "amd" "intel" ]);
-      default = null;
+      default = if config.hardware.cpu.intel.updateMicrocode then "intel"
+        else if config.hardware.cpu.amd.updateMicrocode then "amd"
+        else null;
+      defaultText = literalMD ''
+        if config.hardware.cpu.intel.updateMicrocode then "intel"
+        else if config.hardware.cpu.amd.updateMicrocode then "amd"
+        else null;
+      '';
       description = lib.mdDoc "CPU family of motherboard. Allows for addition motherboard i2c support.";
     };