This commit is contained in:
1 parent
e794e6c0e2
commit
21e5b62dfa
3 files changed
+608
-209
No files matched your search
@@ -1,17 +1,31 @@
|
||||
{ lib, config, ... }:
|
||||
|
||||
{
|
||||
options.bootloader.enable = lib.mkOption {
|
||||
default = false;
|
||||
type = lib.types.bool;
|
||||
};
|
||||
|
||||
config = lib.mkIf config.bootloader.enable {
|
||||
boot = {
|
||||
loader = {
|
||||
systemd-boot.enable = true;
|
||||
efi.canTouchEfiVariables = true;
|
||||
};
|
||||
options.bootloader = {
|
||||
enable = lib.mkOption {
|
||||
default = false;
|
||||
type = lib.types.bool;
|
||||
};
|
||||
firmware = lib.mkOption {
|
||||
default = "uefi";
|
||||
type = lib.types.enum [
|
||||
"bios"
|
||||
"uefi"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf config.bootloader.enable (
|
||||
lib.mkMerge [
|
||||
(lib.mkIf (config.bootloader.firmware == "uefi") {
|
||||
boot.loader = {
|
||||
systemd-boot.enable = true;
|
||||
efi.canTouchEfiVariables = true;
|
||||
};
|
||||
})
|
||||
(lib.mkIf (config.bootloader.firmware == "bios") {
|
||||
boot.loader.grub.enable = true;
|
||||
})
|
||||
]
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user