From f4d8e64bed05489cdb2af880644f1da4d0fe4eef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Wed, 26 Oct 2022 17:05:14 +0200 Subject: [PATCH] nixos/modprobe: replace boot.isContainer with boot.modprobeConfig.enable --- nixos/modules/system/boot/modprobe.nix | 5 ++++- nixos/modules/virtualisation/container-config.nix | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/nixos/modules/system/boot/modprobe.nix b/nixos/modules/system/boot/modprobe.nix index c8ab3b0d8e4a..54bb7ea9ddd7 100644 --- a/nixos/modules/system/boot/modprobe.nix +++ b/nixos/modules/system/boot/modprobe.nix @@ -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"; diff --git a/nixos/modules/virtualisation/container-config.nix b/nixos/modules/virtualisation/container-config.nix index 177e11f0696b..2460ec45e3fc 100644 --- a/nixos/modules/virtualisation/container-config.nix +++ b/nixos/modules/virtualisation/container-config.nix @@ -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;