nixos/doc: add notes on additional drivers or firmware

This describes how to build your own installer medium with some custom
firmware/drivers, using an Intel MacBook as an example - on which WiFi
doesn't work out of the box, due to it being nonfree.

Fixes #15162.

Co-authored-by: Lucas Hoffmann <lucc@users.noreply.github.com>
Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
This commit is contained in:
Florian Klink 2022-04-11 20:54:10 +02:00
parent a12486c442
commit 9ff1ab4037
2 changed files with 65 additions and 0 deletions

View File

@ -30,6 +30,37 @@ To check the content of an ISO image, mount it like so:
# mount -o loop -t iso9660 ./result/iso/cd.iso /mnt/iso
```
## Additional drivers or firmware {#sec-building-image-drivers}
If you need additional (non-distributable) drivers or firmware in the
installer, you might want to extend these configurations.
For example, to build the GNOME graphical installer ISO, but with support for
certain WiFi adapters present in some MacBooks, you can create the following
file at `modules/installer/cd-dvd/installation-cd-graphical-gnome-macbook.nix`:
```nix
{ config, ... }:
{
imports = [ ./installation-cd-graphical-gnome.nix ];
boot.initrd.kernelModules = [ "wl" ];
boot.kernelModules = [ "kvm-intel" "wl" ];
boot.extraModulePackages = [ config.boot.kernelPackages.broadcom_sta ];
}
```
Then build it like in the example above:
```ShellSession
$ git clone https://github.com/NixOS/nixpkgs.git
$ cd nixpkgs/nixos
$ export NIXPKGS_ALLOW_UNFREE=1
$ nix-build -A config.system.build.isoImage -I nixos-config=modules/installer/cd-dvd/installation-cd-graphical-gnome-macbook.nix default.nix
```
## Technical Notes {#sec-building-image-tech-notes}
The config value enforcement is implemented via `mkImageMediaOverride = mkOverride 60;`

View File

@ -43,6 +43,40 @@ $ nix-build -A config.system.build.isoImage -I nixos-config=modules/installer/cd
</para>
<programlisting>
# mount -o loop -t iso9660 ./result/iso/cd.iso /mnt/iso
</programlisting>
</section>
<section xml:id="sec-building-image-drivers">
<title>Additional drivers or firmware</title>
<para>
If you need additional (non-distributable) drivers or firmware in
the installer, you might want to extend these configurations.
</para>
<para>
For example, to build the GNOME graphical installer ISO, but with
support for certain WiFi adapters present in some MacBooks, you
can create the following file at
<literal>modules/installer/cd-dvd/installation-cd-graphical-gnome-macbook.nix</literal>:
</para>
<programlisting language="bash">
{ config, ... }:
{
imports = [ ./installation-cd-graphical-gnome.nix ];
boot.initrd.kernelModules = [ &quot;wl&quot; ];
boot.kernelModules = [ &quot;kvm-intel&quot; &quot;wl&quot; ];
boot.extraModulePackages = [ config.boot.kernelPackages.broadcom_sta ];
}
</programlisting>
<para>
Then build it like in the example above:
</para>
<programlisting>
$ git clone https://github.com/NixOS/nixpkgs.git
$ cd nixpkgs/nixos
$ export NIXPKGS_ALLOW_UNFREE=1
$ nix-build -A config.system.build.isoImage -I nixos-config=modules/installer/cd-dvd/installation-cd-graphical-gnome-macbook.nix default.nix
</programlisting>
</section>
<section xml:id="sec-building-image-tech-notes">