|
8 | 8 | inherit (config.boot.kernel) features randstructSeed;
|
9 | 9 | inherit (config.boot.kernelPackages) kernel;
|
10 | 10 |
|
| 11 | + modulesTypeDesc = '' |
| 12 | + This can either be a list of modules, or an attrset. In an |
| 13 | + attrset, names that are set to `true` represent modules that will |
| 14 | + be included. Note that setting these names to `false` does not |
| 15 | + blacklist those modules. For that, use |
| 16 | + {option}`boot.blacklistedKernelModules`. |
| 17 | + ''; |
| 18 | + |
11 | 19 | kernelModulesConf = pkgs.writeText "nixos.conf"
|
12 | 20 | ''
|
13 | 21 | ${concatStringsSep "\n" config.boot.kernelModules}
|
|
175 | 183 | };
|
176 | 184 |
|
177 | 185 | boot.kernelModules = mkOption {
|
178 |
| - type = types.listOf types.str; |
179 |
| - default = []; |
| 186 | + type = types.attrNamesToTrue; |
| 187 | + default = { }; |
180 | 188 | description = ''
|
181 | 189 | The set of kernel modules to be loaded in the second stage of
|
182 | 190 | the boot process. Note that modules that are needed to
|
183 | 191 | mount the root file system should be added to
|
184 | 192 | {option}`boot.initrd.availableKernelModules` or
|
185 | 193 | {option}`boot.initrd.kernelModules`.
|
| 194 | +
|
| 195 | + ${modulesTypeDesc} |
186 | 196 | '';
|
| 197 | + apply = mods: lib.attrNames (lib.filterAttrs (_: v: v) mods); |
187 | 198 | };
|
188 | 199 |
|
189 | 200 | boot.initrd.availableKernelModules = mkOption {
|
190 |
| - type = types.listOf types.str; |
191 |
| - default = []; |
| 201 | + type = types.attrNamesToTrue; |
| 202 | + default = { }; |
192 | 203 | example = [ "sata_nv" "ext3" ];
|
193 | 204 | description = ''
|
194 | 205 | The set of kernel modules in the initial ramdisk used during the
|
|
204 | 215 | modules for PCI devices are loaded when they match the PCI ID
|
205 | 216 | of a device in your system). To force a module to be loaded,
|
206 | 217 | include it in {option}`boot.initrd.kernelModules`.
|
| 218 | +
|
| 219 | + ${modulesTypeDesc} |
207 | 220 | '';
|
| 221 | + apply = mods: lib.attrNames (lib.filterAttrs (_: v: v) mods); |
208 | 222 | };
|
209 | 223 |
|
210 | 224 | boot.initrd.kernelModules = mkOption {
|
211 |
| - type = types.listOf types.str; |
212 |
| - default = []; |
213 |
| - description = "List of modules that are always loaded by the initrd."; |
| 225 | + type = types.attrNamesToTrue; |
| 226 | + default = { }; |
| 227 | + description = '' |
| 228 | + Set of modules that are always loaded by the initrd. |
| 229 | +
|
| 230 | + ${modulesTypeDesc} |
| 231 | + ''; |
| 232 | + apply = mods: lib.attrNames (lib.filterAttrs (_: v: v) mods); |
214 | 233 | };
|
215 | 234 |
|
216 | 235 | boot.initrd.includeDefaultModules = mkOption {
|
|
0 commit comments