mirror of
https://git.mediani.de/mirrors_public/oddlama_nixos-extra-modules.git
synced 2025-10-11 06:10: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 = [
|
imports = [
|
||||||
./interface-naming.nix
|
./interface-naming.nix
|
||||||
|
./boot.nix
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue