refactor(nixos): move hardware config options to machine nixos module
This commit is contained in:
parent
91c2790b62
commit
8165d96d7c
15 changed files with 70 additions and 84 deletions
30
modules/nixos/machine/bootloader/default.nix
Normal file
30
modules/nixos/machine/bootloader/default.nix
Normal file
|
@ -0,0 +1,30 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
let
|
||||
inherit (lib.pantheon) mkStrOption;
|
||||
cfg = config.machine.bootloader;
|
||||
in
|
||||
{
|
||||
options.machine.bootloader = {
|
||||
type = mkStrOption;
|
||||
};
|
||||
config = lib.mkMerge [
|
||||
{
|
||||
boot.initrd.availableKernelModules = [
|
||||
"nvme"
|
||||
"xhci_pci"
|
||||
"ahci"
|
||||
"usbhid"
|
||||
"usb_storage"
|
||||
"sd_mod"
|
||||
];
|
||||
boot.loader.efi.canTouchEfiVariables = true;
|
||||
}
|
||||
(lib.mkIf (config.machine.bootloader.type == "systemd-boot") {
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
})
|
||||
];
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue