about summary refs log tree commit diff
path: root/nixos/modules/services/hardware
diff options
context:
space:
mode:
authorWeijia Wang <9713184+wegank@users.noreply.github.com>2023-09-07 22:55:34 +0200
committerGitHub <noreply@github.com>2023-09-07 22:55:34 +0200
commiteb1c3455121fe24c3785dfa9aa0a1875a34dc1a6 (patch)
tree4b757c3a181d2f9725425f5ad2777a4e058b693e /nixos/modules/services/hardware
parentdea04c1a3b75c24a5bf6e74ad44450286394fec6 (diff)
parentf6fa02c984f46a7157e72feab59608662d740d3a (diff)
downloadnixlib-eb1c3455121fe24c3785dfa9aa0a1875a34dc1a6.tar
nixlib-eb1c3455121fe24c3785dfa9aa0a1875a34dc1a6.tar.gz
nixlib-eb1c3455121fe24c3785dfa9aa0a1875a34dc1a6.tar.bz2
nixlib-eb1c3455121fe24c3785dfa9aa0a1875a34dc1a6.tar.lz
nixlib-eb1c3455121fe24c3785dfa9aa0a1875a34dc1a6.tar.xz
nixlib-eb1c3455121fe24c3785dfa9aa0a1875a34dc1a6.tar.zst
nixlib-eb1c3455121fe24c3785dfa9aa0a1875a34dc1a6.zip
Merge pull request #253048 from Mic92/openrbg
nixos/openrbg: set cpu model based on what microcode updates are enabled
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 310615ecc539..13b1d07e53b7 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.";
     };