Jump to content

NixOS on LoongArch: Difference between revisions

From Official NixOS Wiki
Weijia (talk | contribs)
Clarify hardware requirements
Weijia (talk | contribs)
Clarify Nixpkgs support for architectures
Line 1: Line 1:
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.
NixOS does not provide official support for LoongArch architectures. Nixpkgs supports the <code>loongarch64-linux</code> architecture as a Tier 3 platform, and community support for NixOS is available through the [https://nix4loong.cn/en Nix4Loong] project. The <code>loongarch32-linux</code> architecture is not supported by Nixpkgs.


== Supported hardware ==
== Supported hardware ==
Line 9: Line 9:
== Installation ==
== Installation ==


For the loongarch64-linux architecture, graphical and minimal installation ISOs are available from [https://nix4loong.cn/en/installation#nixos Installation — Nix4Loong].
Graphical and minimal installation ISOs are available from [https://nix4loong.cn/en/installation#nixos Installation — Nix4Loong].


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

Revision as of 00:24, 24 October 2026

NixOS does not provide official support for LoongArch architectures. Nixpkgs supports the loongarch64-linux architecture as a Tier 3 platform, and community support for NixOS is available through the Nix4Loong project. The loongarch32-linux architecture is not supported by Nixpkgs.

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

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.