From ec2016dda402ded1261d2af0e29d02506b191eab Mon Sep 17 00:00:00 2001 From: Julian Stecklina Date: Thu, 30 Nov 2023 17:03:09 +0100 Subject: [PATCH] doc: explain how to enable Rust support in the Linux kernel --- .../configuration/linux-kernel.chapter.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/nixos/doc/manual/configuration/linux-kernel.chapter.md b/nixos/doc/manual/configuration/linux-kernel.chapter.md index 9d1b2bc2f9b8..99c94fe64e82 100644 --- a/nixos/doc/manual/configuration/linux-kernel.chapter.md +++ b/nixos/doc/manual/configuration/linux-kernel.chapter.md @@ -92,6 +92,24 @@ To use your custom kernel package in your NixOS configuration, set boot.kernelPackages = pkgs.linuxPackagesFor yourCustomKernel; ``` +## Rust + +The Linux kernel does not have Rust language support enabled by +default. For kernel versions 6.7 or newer, experimental Rust support +can be enabled. In a NixOS configuration, set: + +```nix +boot.kernelPatches = [ + { + name = "Rust Support"; + patch = null; + features = { + rust = true; + }; + } +]; +``` + ## Developing kernel modules {#sec-linux-config-developing-modules} This section was moved to the [Nixpkgs manual](https://nixos.org/nixpkgs/manual#sec-linux-kernel-developing-modules).