Skip to content

Commit

Permalink
Merge pull request #64 from Enzime/push-xnktvrpystyp
Browse files Browse the repository at this point in the history
networking/initrd: init module
  • Loading branch information
brianmcgee authored Dec 19, 2024
2 parents 8626485 + 391bb3f commit 5364727
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions modules/nixos/networking/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{
imports = [
./broadcom.nix
./initrd.nix
./intel.nix
];

Expand Down
21 changes: 21 additions & 0 deletions modules/nixos/networking/initrd.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{ lib, config, ... }:
let
facterLib = import ../../../lib/lib.nix lib;

inherit (config.facter) report;
in
{
options.facter.detected.boot.initrd.networking.kernelModules = lib.mkOption {
type = lib.types.listOf lib.types.str;
default = facterLib.stringSet (
facterLib.collectDrivers (report.hardware.network_controller or [ ])
);
description = ''
List of kernel modules to include in the initrd to support networking.
'';
};

config = lib.mkIf config.boot.initrd.network.enable {
boot.initrd.kernelModules = config.facter.detected.boot.initrd.networking.kernelModules;
};
}

0 comments on commit 5364727

Please sign in to comment.