mirror of
https://github.com/oddlama/nixos-extra-modules.git
synced 2025-10-10 22:00:39 +02:00
feat: added default boot modes
This commit is contained in:
parent
073a8ae3b3
commit
5072dd354d
2 changed files with 36 additions and 0 deletions
35
modules/boot.nix
Normal file
35
modules/boot.nix
Normal file
|
@ -0,0 +1,35 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
option.boot.mode = lib.mkOption {
|
||||
description = "Enable recommended Options for different boot modes";
|
||||
type = lib.types.nullOr (lib.types.enum ["bios" "efi" "secureboot"]);
|
||||
default = null;
|
||||
};
|
||||
config = let
|
||||
bios-conf = {
|
||||
boot.loader.grub = {
|
||||
enable = true;
|
||||
efiSupport = false;
|
||||
configurationLimit = 32;
|
||||
};
|
||||
};
|
||||
efi-conf = {
|
||||
# Use the systemd-boot EFI boot loader.
|
||||
boot.loader = {
|
||||
systemd-boot.enable = true;
|
||||
systemd-boot.configurationLimit = 32;
|
||||
efi.canTouchEfiVariables = true;
|
||||
};
|
||||
};
|
||||
in
|
||||
lib.mkIf (config.boot.mode != null)
|
||||
{
|
||||
"efi" = efi-conf;
|
||||
"bios" = bios-conf;
|
||||
"secureboot" = throw "not yet implemented";
|
||||
}
|
||||
.${config.boot.mode};
|
||||
}
|
|
@ -1,5 +1,6 @@
|
|||
{
|
||||
imports = [
|
||||
./interface-naming.nix
|
||||
./boot.nix
|
||||
];
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue