Skip to content

andreoss/kernel-overlay

Repository files navigation

Kernel overlay

Builds of vanilla Linux kernel for Nix.

Available releases

Version Package Date
6.9.2 stable 2024-05-25
6.9 mainline 2024-05-12
6.8.11 stable 2024-05-25
6.6.32 6_6 2024-05-25
6.1.92 6_1 2024-05-25
5.4.277 5_4 2024-05-25
5.15.160 5_15 2024-05-25
5.10.218 5_10 2024-05-25
4.19.315 4_19 2024-05-25

The currently available releases are regularly scrapped from https://kernel.org. Run nix flake show github:andreoss/kernel-overlay to see exact versions.

  • linuxPackages is an alias for the latest stable release.
  • linuxPackages_testing is an alias for the latest mainline release.

Installation

(Optional) Enable cachix substitutions in nix.settings. Note: this change will be applied only nix-daemon restart

  nix.settings = {
    experimental-features = [ "nix-command" "flakes" ];
    substituters = [ "https://kernel-overlay.cachix.org" ];
    trusted-public-keys = [
      "kernel-overlay.cachix.org-1:rUvSa2sHn0a7RmwJDqZvijlzZHKeGvmTQfOUr2kaxr4="
    ];
  };

Add as an input to a flake

{
  description = "OS configuration";
  inputs = {
    ...
    kernel-overlay.url = "github:andreoss/kernel-overlay";
    ...

Enable overlay

 outputs = inputs@{ self, nixpkgs, home-manager, ... }:
   let
     systems = lib.systems.flakeExposed;
     lib = nixpkgs.lib;
     eachSystem = lib.genAttrs systems;
   in rec {
     legacyPackages = eachSystem (system:
       import nixpkgs {
         inherit system;
         overlays = [
           inputs.kernel-overlay.overlays.default
         ];
       });
     ...

By default this overlays replaces the default kernel package. In order to use a specific one, specify it inconfiguration.nix. For example

  boot.kernelPackages = pkgs.linuxPackages_4_14;