Skip to content

Nix4Loong/nix-loongarch-kernel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nix-loongarch-kernel

Linux stable kernel with additional patches for LoongArch platforms.

Check available versions in tags, though staying up-to-date with main is recommended.

Patches

  • Motorcomm YT6801 NIC driver
  • HWMon support for Loongson 3 family processors
  • PixArt PS/2 touchpad driver
  • Legacy firmware boot support and AMD GPU stability fixes
  • Full patch list: https://loongfans.cn/pages/sdk.html

Binary Cache

To speed up builds, you can use the binary cache provided by nix4loong.cn:

nix.extraOptions = ''
  extra-substituters = https://cache.nix4loong.cn
  extra-trusted-public-keys = cache.nix4loong.cn-1:zmkwLihdSUyy6OFSVgvK3br0EaUEczLiJgDfvOmm3pA=
'';

Alternatively, use the installation image from nix4loong.cn, which comes with the cache and the kernel pre-configured.

Usage

Option 1: NixOS Module (Recommended)

This method is recommended as it can take full advantage of the binary cache.

{
  inputs.nix-loongarch-kernel.url = "github:darkyzhou/nix-loongarch-kernel";

  outputs = { self, nixpkgs, nix-loongarch-kernel, ... }: {
    nixosConfigurations.myhost = nixpkgs.lib.nixosSystem {
      system = "loongarch64-linux";
      modules = [
        nix-loongarch-kernel.nixosModules.default
      ];
    };
  };
}

Option 2: Overlay

Note: Using an overlay may not hit the binary cache due to different derivation hashes.

{
  inputs.nix-loongarch-kernel.url = "github:darkyzhou/nix-loongarch-kernel";

  outputs = { self, nixpkgs, nix-loongarch-kernel, ... }: {
    nixosConfigurations.myhost = nixpkgs.lib.nixosSystem {
      system = "loongarch64-linux";
      modules = [
        {
          nixpkgs.overlays = [ nix-loongarch-kernel.overlay ];
          boot.kernelPackages = pkgs.linuxPackages-nix4loong;
        }
      ];
    };
  };
}

Acknowledgements

Special thanks to loongfans.cn and all the patch authors for their contributions.

About

Nix flakes for latest Linux kernel with patches for LoongArch platforms

Resources

License

Stars

Watchers

Forks

Languages