patos/modules/config/minimal-modules.nix
Daniel Lundin cca2a0ed75
All checks were successful
ci/woodpecker/pr/ci Pipeline was successful
WIP: next step on image build
2024-11-14 00:50:38 +01:00

19 lines
601 B
Nix

{ config, lib, ... }: {
options.boot.kernel.minimalModules = lib.mkEnableOption "minimal kernel modules";
config = lib.mkIf config.boot.kernel.minimalModules {
# Don't include kernel or its modules in rootfs
boot.kernel.enable = false;
boot.modprobeConfig.enable = false;
boot.bootspec.enable = false;
system.build = { inherit (config.boot.kernelPackages) kernel; };
system.modulesTree = [ config.boot.kernelPackages.kernel ] ++ config.boot.extraModulePackages;
# Modules must be loaded by initrd
boot.initrd.kernelModules = config.boot.kernelModules;
};
}