about summary refs log tree commit diff
path: root/nixos/modules/hardware
diff options
context:
space:
mode:
authorPhil Dyer <phildyer@protonmail.com>2024-04-11 11:40:43 +1000
committerPhil Dyer <phildyer@protonmail.com>2024-04-11 11:40:43 +1000
commitba0566726ec5c55f4091fb3dd93a9b313215384d (patch)
treeabbe16daa24b1ea1c48e21300d589dc1eb16f4c2 /nixos/modules/hardware
parentcc0f05649269e39170b59716af72ff738ef5b931 (diff)
downloadnixlib-ba0566726ec5c55f4091fb3dd93a9b313215384d.tar
nixlib-ba0566726ec5c55f4091fb3dd93a9b313215384d.tar.gz
nixlib-ba0566726ec5c55f4091fb3dd93a9b313215384d.tar.bz2
nixlib-ba0566726ec5c55f4091fb3dd93a9b313215384d.tar.lz
nixlib-ba0566726ec5c55f4091fb3dd93a9b313215384d.tar.xz
nixlib-ba0566726ec5c55f4091fb3dd93a9b313215384d.tar.zst
nixlib-ba0566726ec5c55f4091fb3dd93a9b313215384d.zip
nixos/ryzen-smu: init module
Provide a module for installing ryzen_smu, a Linux kernel driver
that exposes access to the SMU (System Management Unit) for
certain AMD Ryzen Processors.

Installs monitor_cpu, a userspace tool for viewing info.

Using fork of original to match ryzen_monitor_ng, a more advanced
userspace tool for accessing the SMU via this kernel module,
planned for a later commit.
Diffstat (limited to 'nixos/modules/hardware')
-rw-r--r--nixos/modules/hardware/cpu/amd-ryzen-smu.nix26
1 files changed, 26 insertions, 0 deletions
diff --git a/nixos/modules/hardware/cpu/amd-ryzen-smu.nix b/nixos/modules/hardware/cpu/amd-ryzen-smu.nix
new file mode 100644
index 000000000000..b1a5895aaa24
--- /dev/null
+++ b/nixos/modules/hardware/cpu/amd-ryzen-smu.nix
@@ -0,0 +1,26 @@
+{ config
+, lib
+, ...
+}:
+let
+  inherit (lib) mkEnableOption mkIf;
+  cfg = config.hardware.cpu.amd.ryzen-smu;
+  ryzen-smu = config.boot.kernelPackages.ryzen-smu;
+in
+{
+  options.hardware.cpu.amd.ryzen-smu = {
+    enable = mkEnableOption ''
+        ryzen_smu, a linux kernel driver that exposes access to the SMU (System Management Unit) for certain AMD Ryzen Processors.
+
+        WARNING: Damage cause by use of your AMD processor outside of official AMD specifications or outside of factory settings are not covered under any AMD product warranty and may not be covered by your board or system manufacturer's warranty
+      '';
+  };
+
+  config = mkIf cfg.enable {
+    boot.kernelModules = [ "ryzen-smu" ];
+    boot.extraModulePackages = [ ryzen-smu ];
+    environment.systemPackages = [ ryzen-smu ];
+  };
+
+  meta.maintainers = with lib.maintainers; [ Cryolitia phdyellow ];
+}