summaryrefslogtreecommitdiff
path: root/pkgs/os-specific/linux/amdgpu-i2c/default.nix
blob: f8dff5e02708b495ec06143a4c15fc62ecbc8ec9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
{
  stdenv,
  lib,
  fetchFromGitHub,
  kernel,
}:

let
  KDIR = "${kernel.dev}/lib/modules/${kernel.modDirVersion}/build";
in
stdenv.mkDerivation {
  pname = "amdgpu-i2c";
  version = "0-unstable-2024-12-16";

  src = fetchFromGitHub {
    owner = "twifty";
    repo = "amd-gpu-i2c";
    rev = "06ca41fd12fb90f970d3ebd4785cc26cc0a3f3b0";
    sha256 = "sha256-GVyrwnwNSBW4OCNDqQMU6e31C4bG14arC0MPkRWfiJQ=";
  };

  hardeningDisable = [ "pic" ];

  nativeBuildInputs = kernel.moduleBuildDependencies;

  buildPhase = "make -C ${KDIR} M=/build/source modules";
  installPhase = ''
    make -C ${KDIR} M=/build/source INSTALL_MOD_PATH="$out" modules_install
  '';

  meta = {
    homepage = "https://github.com/twifty/amd-gpu-i2c";
    downloadPage = "https://github.com/twifty/amd-gpu-i2c";
    description = "Exposes i2c interface to set colors on AMD GPUs";
    broken = kernel.kernelOlder "6.1.0";
    license = lib.licenses.gpl2Plus;
    platforms = lib.platforms.linux;
    maintainers = with lib.maintainers; [ thardin ];
  };
}