summaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>2024-06-12 00:02:10 +0000
committerGitHub <noreply@github.com>2024-06-12 00:02:10 +0000
commit477d2d32ff5e59c4c91bcd3a7cb61b320f2c18be (patch)
tree912b5f907e298b362c87253b04fe7933b2ae4dc0 /doc
parent2d3f5e7db617ae7662dac5a1d683e7c8d5a90548 (diff)
parente913ae340076bbb73d9f4d3d065c2bca7caafb16 (diff)
Merge master into staging-next
Diffstat (limited to 'doc')
-rw-r--r--doc/packages/linux.section.md20
1 files changed, 7 insertions, 13 deletions
diff --git a/doc/packages/linux.section.md b/doc/packages/linux.section.md
index 4c3b2a3b132a..90d14772134b 100644
--- a/doc/packages/linux.section.md
+++ b/doc/packages/linux.section.md
@@ -40,31 +40,29 @@ pkgs.linux_latest.override {
## Manual kernel configuration {#sec-manual-kernel-configuration}
Sometimes it may not be desirable to use kernels built with `pkgs.buildLinux`, especially if most of the common configuration has to be altered or disabled to achieve a kernel as expected by the target use case.
-An example of this is building a kernel for use in a VM or micro VM. You can use `pkgs.linuxManualConfig` in these cases. It requires the `src`, `version`, and `configfile` attributes to be specified.
+An example of this is building a kernel for use in a VM or micro VM. You can use `pkgs.linuxPackages_custom` in these cases. It requires the `src`, `version`, and `configfile` attributes to be specified.
:::{.example #ex-using-linux-manual-config}
-# Using `pkgs.linuxManualConfig` with a specific source, version, and config file
+# Using `pkgs.linuxPackages_custom` with a specific source, version, and config file
```nix
-{ pkgs, ... }: {
+{ pkgs, ... }:
+pkgs.linuxPackages_custom {
version = "6.1.55";
src = pkgs.fetchurl {
url = "https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-${version}.tar.xz";
hash = "sha256:1h0mzx52q9pvdv7rhnvb8g68i7bnlc9rf8gy9qn4alsxq4g28zm8";
};
configfile = ./path_to_config_file;
- linux = pkgs.linuxManualConfig {
- inherit version src configfile;
- allowImportFromDerivation = true;
- };
}
```
If necessary, the version string can be slightly modified to explicitly mark it as a custom version. If you do so, ensure the `modDirVersion` attribute matches the source's version, otherwise the build will fail.
```nix
-{ pkgs, ... }: {
+{ pkgs, ... }:
+pkgs.linuxPackages_custom {
version = "6.1.55-custom";
modDirVersion = "6.1.55";
src = pkgs.fetchurl {
@@ -72,16 +70,12 @@ If necessary, the version string can be slightly modified to explicitly mark it
hash = "sha256:1h0mzx52q9pvdv7rhnvb8g68i7bnlc9rf8gy9qn4alsxq4g28zm8";
};
configfile = ./path_to_config_file;
- linux = pkgs.linuxManualConfig {
- inherit version modDirVersion src configfile;
- allowImportFromDerivation = true;
- };
}
```
:::
-Additional attributes can be used with `linuxManualConfig` for further customisation. You're encouraged to read [the `pkgs.linuxManualConfig` source code](https://github.com/NixOS/nixpkgs/blob/d77bda728d5041c1294a68fb25c79e2d161f62b9/pkgs/os-specific/linux/kernel/manual-config.nix) to understand how to use them.
+Additional attributes can be used with `linuxManualConfig` for further customisation instead of `linuxPackages_custom`. You're encouraged to read [the `pkgs.linuxManualConfig` source code](https://github.com/NixOS/nixpkgs/blob/d77bda728d5041c1294a68fb25c79e2d161f62b9/pkgs/os-specific/linux/kernel/manual-config.nix) to understand how to use them.
To edit the `.config` file for Linux X.Y from within Nix, proceed as follows: