Jump to content

NixOS on LoongArch

From Official NixOS Wiki
Revision as of 00:07, 24 October 2026 by Weijia (talk | contribs) (Clarify hardware requirements)

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

NixOS 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.

NixOS also expects UEFI firmware compatible with the new-world LoongArch boot protocol. Older firmware may require additional patches. 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.