CachyOS kernel for NixOS
Go to file
2025-12-08 19:55:53 -08:00
.github Add GitHub Actions flow to update flake lock automatically 2025-12-08 19:55:53 -08:00
kernel-cachyos Auto detect modDirVersion for each kernel 2025-12-08 19:23:06 -08:00
.gitignore Initial commit 2025-12-08 19:10:56 -08:00
flake.lock Initial commit 2025-12-08 19:10:56 -08:00
flake.nix Add overlay and example NixOS configuration 2025-12-08 19:46:57 -08:00
garnix.yaml Do not build aarch64 kernels on Garnix due to weird errors 2025-12-08 19:22:21 -08:00
helpers.nix Initial commit 2025-12-08 19:10:56 -08:00
README.md Add overlay and example NixOS configuration 2025-12-08 19:46:57 -08:00

Nix packages for CachyOS Kernel

This repo contains Linux kernels with both CachyOS patches and CachyOS tunings.

Which kernel versions are provided?

This repo provides the latest kernel version and the latest LTS kernel version:

└───packages
    ├───aarch64-linux
        ├───linux-cachyos-latest
        ├───linux-cachyos-latest-lto
        ├───linux-cachyos-lts
        └───linux-cachyos-lts-lto
    └───x86_64-linux
        ├───linux-cachyos-latest
        ├───linux-cachyos-latest-lto
        ├───linux-cachyos-lts
        └───linux-cachyos-lts-lto

The kernel versions are automatically kept in sync with Nixpkgs, so once the latest/LTS kernel is updated in Nixpkgs, CachyOS kernels in this repo will automatically catch up.

The kernels ending in -lto has Clang+ThinLTO enabled.

For each linux kernel entry under packages, we have a corresponding linuxPackages entry under legacyPackages for easier use in your NixOS configuration, e.g.:

  • linux-cachyos-latest -> inputs.nix-cachyos-kernel.legacyPackages.x86_64-linux.linuxPackages-cachyos-latest
  • linux-cachyos-lts-lto -> inputs.nix-cachyos-kernel.legacyPackages.x86_64-linux.linuxPackages-cachyos-lts-lto

How to use

Add this repo to the inputs section of your flake.nix:

{
  inputs = {
    nix-cachyos-kernel.url = "github:xddxdd/nix-cachyos-kernel";
  }
}

Add the repo's overlay in your NixOS configuration, this will expose the packages in this flake as pkgs.cachyosKernels.*.

Then specify pkgs.cachyosKernels.linuxPackages-cachyos-latest (or other variants you'd like) in your boot.kernelPackages option.

Example configuration

{
  nixosConfigurations.example = inputs.nixpkgs.lib.nixosSystem {
    system = "x86_64-linux";
    modules = [
      (
        { pkgs, ... }:
        {
          nixpkgs.overlays = [ self.overlay ];
          boot.kernelPackages = pkgs.cachyosKernels.linuxPackages-cachyos-latest;
          # ... your other configs
        }
      )
    ];
  };
}