diff options
author | Aleksana <me@aleksana.moe> | 2024-04-12 00:15:45 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-12 00:15:45 +0800 |
commit | 029c95c7809cea37cb2016e10c8601a1cf5c59bd (patch) | |
tree | 26b768292bc1e2d5622df9ac1e00baeb4c09d7ef /pkgs/os-specific | |
parent | 03b8fd0d9b38defb4610e2b76c4c8e3d98caf4a2 (diff) | |
parent | 97899b5ba66be56998c7520b44b9710b1686706f (diff) |
Merge pull request #271342 from PhDyellow/ryzen_smu
ryzen_smu: init at 0.1.5, ryzen_monitor_ng: init at 2.0.5
Diffstat (limited to 'pkgs/os-specific')
-rw-r--r-- | pkgs/os-specific/linux/ryzen-smu/default.nix | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/pkgs/os-specific/linux/ryzen-smu/default.nix b/pkgs/os-specific/linux/ryzen-smu/default.nix new file mode 100644 index 0000000000000..7f899f2c2c90c --- /dev/null +++ b/pkgs/os-specific/linux/ryzen-smu/default.nix @@ -0,0 +1,69 @@ +{ lib +, stdenv +, fetchFromGitHub +, kernel +}: + +let + version = "0.1.5-unstable-2024-01-03"; + + ## Upstream has not been merging PRs. + ## Nixpkgs maintainers are providing a + ## repo with PRs merged until upstream is + ## updated. + src = fetchFromGitHub { + owner = "Cryolitia"; + repo = "ryzen_smu"; + rev = "ce1aa918efa33ca79998f0f7d467c04d4b07016c"; + hash = "sha256-s9SSmbL6ixWqZUKEhrZdxN4xoWgk+8ClZPoKq2FDAAE="; + }; + + monitor-cpu = stdenv.mkDerivation { + pname = "monitor-cpu"; + inherit version src; + + makeFlags = [ + "-C userspace" + ]; + + installPhase = '' + runHook preInstall + + install userspace/monitor_cpu -Dm755 -t $out/bin + + runHook postInstall + ''; + }; + +in +stdenv.mkDerivation { + pname = "ryzen-smu-${kernel.version}"; + inherit version src; + + hardeningDisable = [ "pic" ]; + + nativeBuildInputs = kernel.moduleBuildDependencies; + + makeFlags = [ + "TARGET=${kernel.modDirVersion}" + "KERNEL_BUILD=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" + ]; + + installPhase = '' + runHook preInstall + + install ryzen_smu.ko -Dm444 -t $out/lib/modules/${kernel.modDirVersion}/kernel/drivers/ryzen_smu + install ${monitor-cpu}/bin/monitor_cpu -Dm755 -t $out/bin + + runHook postInstall + ''; + + meta = with lib; { + description = "A Linux kernel driver that exposes access to the SMU (System Management Unit) for certain AMD Ryzen Processors"; + homepage = "https://gitlab.com/leogx9r/ryzen_smu"; + license = licenses.gpl2Plus; + maintainers = with maintainers; [ Cryolitia phdyellow ]; + platforms = [ "x86_64-linux" ]; + mainProgram = "monitor_cpu"; + }; +} |