about summary refs log tree commit diff
path: root/system/modules/kernel.nix
blob: 92aa6955a73b02b9cf1d6f8ad98edebb559008c0 (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
{ config, lib, pkgs, ... }:
with lib.versions;
let
  inherit (pkgs) runCommand;
  kernelRelease = config.linuxPackages.kernel.version or pkgs.linux.version;
  mj = major kernelRelease;
  mm = majorMinor kernelRelease;
  linux-ck = runCommand "linux-ck-combined.patch" {} ''
    ${pkgs.xz}/bin/unxz -kfdc ${builtins.fetchurl {
      # http://ck.kolivas.org/patches/5.0/5.4/5.4-ck1/patch-5.4-ck1.xz
      url = "http://ck.kolivas.org/patches/${mj}.0/${mm}/${mm}-ck1/patch-${mm}-ck1.xz";
      sha256 = "0p2ccwlsmq0587x6cnbrk4h2bwpl9342bmhsbyi1a87cs2jfwigl";
    }} > $out
  '';
in
{
  boot.kernelPackages = pkgs.linuxPackages.extend (self: super: {
    kernel = super.kernel.override {
      kernelPatches = super.kernel.kernelPatches ++ [{
        name = "linux-ck";
        patch = linux-ck;
      }];
      argsOverride = {
        modDirVersion = super.kernel.modDirVersion + "-ck1";
      };
    };
  });
}