Jump to content

NixOS on LoongArch: Difference between revisions

From Official NixOS Wiki
Weijia (talk | contribs)
Add section on nix-loongarch-kernel
Weijia (talk | contribs)
Add section on supported hardware
Line 1: Line 1:
{{Expansion}}
NixOS does not provide official support for LoongArch architectures. For the loongarch64-linux architecture, however, community support is available through the [https://nix4loong.cn/en Nix4Loong] project.
 
== Supported hardware ==
 
Nix4Loong requires a 64-bit LoongArch processor supporting at least the <code>la64v1.0</code> feature baseline. Compatible processors include the Loongson 3A5000, 3C5000 series, 3A6000, 3B6000 series, 3C6000 series, and 2K3000. The 2K0300 and older MIPS-based processors, such as the 3A4000, are not supported.


NixOS does not provide official support for LoongArch architectures. For the loongarch64-linux architecture, however, community support is available through the [https://nix4loong.cn/en Nix4Loong] project.
Installing NixOS also requires UEFI firmware compatible with the new-world LoongArch boot protocol. Updating the device firmware to the [https://loongfans.cn/en/devices latest version] is recommended.


== Installation ==
== Installation ==

Revision as of 23:57, 23 October 2026

NixOS does not provide official support for LoongArch architectures. For the loongarch64-linux architecture, however, community support is available through the Nix4Loong project.

Supported hardware

Nix4Loong requires a 64-bit LoongArch processor supporting at least the la64v1.0 feature baseline. Compatible processors include the Loongson 3A5000, 3C5000 series, 3A6000, 3B6000 series, 3C6000 series, and 2K3000. The 2K0300 and older MIPS-based processors, such as the 3A4000, are not supported.

Installing NixOS also requires UEFI firmware compatible with the new-world LoongArch boot protocol. Updating the device firmware to the latest version is recommended.

Installation

For the loongarch64-linux architecture, graphical and minimal installation ISOs are available from Installation — Nix4Loong.

Once the ISO image is downloaded, refer to NixOS Installation Guide to get started.

Binary cache

Nix4Loong provides a binary cache with infrastructure support from Matrix at Sun Yat-sen University. An additional mirror is also maintained by the Nanjing University Linux Users Group:

nix.settings = {
  substituters = [
    "https://cache.nix4loong.cn" # "https://mirror.sysu.edu.cn/nix4loong/store"
    "https://mirrors.nju.edu.cn/nix4loong/store"
  ];
  trusted-public-keys = [
    "cache.nix4loong.cn-1:zmkwLihdSUyy6OFSVgvK3br0EaUEczLiJgDfvOmm3pA="
  ];
};

Hydra

Nix4Loong maintains a Hydra instance that tracks the master and staging-next branches, as well as their corresponding release branches. The Hydra jobs are defined in the Nix4Loong/hydra-jobs repository.

Linux kernel

Nixpkgs supports Linux kernels for LoongArch starting with Linux 6.16. Mainline kernels should generally work for most purposes, though newer kernel versions (such as linuxPackages_latest) are preferred for better hardware support.

For additional hardware compatibility and fixes, Nix4Loong maintains a patched Linux kernel incorporating some of the downstream patches for LoongArch. It can be integrated into NixOS configurations using the provided module or overlay.