nixos/modprobe: replace boot.isContainer with boot.modprobeConfig.enable

This commit is contained in:
Sandro Jäckel 2022-10-26 17:05:14 +02:00
parent 7abad9f4b7
commit f4d8e64bed
No known key found for this signature in database
GPG Key ID: B1763F8651144063
2 changed files with 6 additions and 1 deletions

View File

@ -7,6 +7,9 @@ with lib;
###### interface
options = {
boot.modprobeConfig.enable = mkEnableOption (lib.mdDoc "modprobe config. This is useful for systemds like containers which do not require a kernel.") // {
default = true;
};
boot.blacklistedKernelModules = mkOption {
type = types.listOf types.str;
@ -38,7 +41,7 @@ with lib;
###### implementation
config = mkIf (!config.boot.isContainer) {
config = mkIf config.boot.modprobeConfig.enable {
environment.etc."modprobe.d/ubuntu.conf".source = "${pkgs.kmod-blacklist-ubuntu}/modprobe.conf";

View File

@ -8,7 +8,9 @@ with lib;
# Disable some features that are not useful in a container.
# containers don't have a kernel
boot.kernel.enable = false;
boot.modprobeConfig.enable = false;
console.enable = mkDefault false;