3
0
Fork 0
forked from mirrors/nixpkgs

Merge pull request #168306 from flokli/nixos-doc-installer-drivers

nixos/doc: add notes on additional drivers or firmware
This commit is contained in:
Florian Klink 2022-04-16 15:03:24 +02:00 committed by GitHub
commit b2383b6329
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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">