summary refs log tree commit diff
path: root/pkgs/os-specific/linux/gcadapter-oc-kmod/default.nix
blob: ab2e099d97087ac09f0e222c55178da16d6c268c (plain) (blame)
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
{ lib, stdenv
, fetchFromGitHub
, kernel
, kmod
}:

let
  kerneldir = "lib/modules/${kernel.modDirVersion}";
in stdenv.mkDerivation rec {
  pname = "gcadapter-oc-kmod";
  version = "1.4";

  src = fetchFromGitHub {
    owner = "HannesMann";
    repo = pname;
    rev = "v${version}";
    sha256 = "1nqhj3vqq9rnj37cnm2c4867mnxkr8di3i036shcz44h9qmy9d40";
  };

  nativeBuildInputs = kernel.moduleBuildDependencies;

  makeFlags = [
    "KERNEL_SOURCE_DIR=${kernel.dev}/${kerneldir}/build"
    "INSTALL_MOD_PATH=$(out)"
  ];

  installPhase = ''
    install -D {,$out/${kerneldir}/extra/}gcadapter_oc.ko
  '';

  meta = with lib; {
    description = "Kernel module for overclocking the Nintendo Wii U/Mayflash GameCube adapter";
    homepage = "https://github.com/HannesMann/gcadapter-oc-kmod";
    license = licenses.gpl2;
    maintainers = with maintainers; [ r-burns ];
    platforms = platforms.linux;
  };
}