1
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs synced 2024-10-22 22:16:09 -04:00
nixpkgs/nixos/modules/system/boot/loader/gummiboot/gummiboot.nix

70 lines
1.4 KiB
Nix
Raw Normal View History

{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.boot.loader.gummiboot;
efi = config.boot.loader.efi;
gummibootBuilder = pkgs.substituteAll {
src = ./gummiboot-builder.py;
isExecutable = true;
inherit (pkgs) python gummiboot;
nix = config.nix.package;
timeout = if cfg.timeout != null then cfg.timeout else "";
inherit (efi) efiSysMountPoint canTouchEfiVariables;
};
in {
options.boot.loader.gummiboot = {
enable = mkOption {
default = false;
type = types.bool;
description = "Whether to enable the gummiboot UEFI boot manager";
};
timeout = mkOption {
default = null;
example = 4;
type = types.nullOr types.int;
description = ''
Timeout (in seconds) for how long to show the menu (null if none).
Note that even with no timeout the menu can be forced if the space
key is pressed during bootup
'';
};
};
config = mkIf cfg.enable {
assertions = [
{
2013-03-03 17:48:33 -05:00
assertion = (config.boot.kernelPackages.kernel.features or { efiBootStub = true; }) ? efiBootStub;
message = "This kernel does not support the EFI boot stub";
}
];
2014-04-30 05:41:39 -04:00
boot.loader.grub.enable = mkDefault false;
system = {
build.installBootLoader = gummibootBuilder;
boot.loader.id = "gummiboot";
requiredKernelConfig = with config.lib.kernelConfig; [
(isYes "EFI_STUB")
];
};
};
}