minimize kernel firmware on base systems

This commit is contained in:
chaos 2024-04-01 18:52:00 +02:00
parent 19f6da8d84
commit 4f6c49ab5c
No known key found for this signature in database
6 changed files with 51 additions and 5 deletions

View file

@ -1,5 +1,8 @@
{tree, ...}: { {tree, ...}: {
imports = with tree; [ imports = with tree; [
profiles.wifiHardware
profiles.sound.base
profiles.sound.pipewire profiles.sound.pipewire
profiles.gui.base profiles.gui.base

View file

@ -5,12 +5,16 @@
profiles.connectivity.networkManager profiles.connectivity.networkManager
profiles.connectivity.iOS profiles.connectivity.iOS
profiles.wifiHardware
profiles.tor profiles.tor
]; ];
boot.loader.systemd-boot.editor = true; boot.loader.systemd-boot = {
boot.loader.systemd-boot.memtest86.enable = true; editor = true;
boot.loader.systemd-boot.netbootxyz.enable = true; memtest86.enable = true;
netbootxyz.enable = true;
};
services.fwupd.enable = true; services.fwupd.enable = true;

View file

@ -1,5 +1,6 @@
{tree, ...}: { {tree, ...}: {
imports = with tree; [ imports = with tree; [
profiles.sound.base
profiles.sound.pipewire profiles.sound.pipewire
profiles.gui.base profiles.gui.base

View file

@ -8,10 +8,14 @@
is_x86 = "${pkgs.system}" == "x86_64-linux"; is_x86 = "${pkgs.system}" == "x86_64-linux";
in { in {
hardware = { hardware = {
enableAllFirmware = true; enableAllFirmware = false; # we include a more minimal subset for base
enableRedistributableFirmware = true; enableRedistributableFirmware = false;
wirelessRegulatoryDatabase = true; wirelessRegulatoryDatabase = true;
firmware = with pkgs; [
linux-firmware
];
ksm.enable = true; ksm.enable = true;
i2c.enable = true; i2c.enable = true;

10
profiles/sound/base.nix Normal file
View file

@ -0,0 +1,10 @@
{
lib,
pkgs,
...
}: {
hardware.firmware = with pkgs; [
alsa-firmware
sof-firmware
];
}

24
profiles/wifiHardware.nix Normal file
View file

@ -0,0 +1,24 @@
{
lib,
pkgs,
...
}: let
inherit (lib.lists) optional;
in {
hardware = {
firmware = with pkgs;
[
# Realtek
rtl8192su-firmware
rt5677-firmware
rtl8761b-firmware
rtw88-firmware
# ZyDAS
zd1211fw
# Broadcom
b43Firmware_5_1_138
b43Firmware_6_30_163_46
]
++ optional pkgs.stdenv.hostPlatform.isAarch raspberrypiWirelessFirmware;
};
}