diff --git a/modules/system/boot/module.nix b/modules/system/boot/module.nix index 275fa5d..bc3eeb1 100644 --- a/modules/system/boot/module.nix +++ b/modules/system/boot/module.nix @@ -5,13 +5,21 @@ ... }: let inherit (lib.modules) mkForce; - inherit (lib.options) mkEnableOption; + inherit (lib.options) mkOption mkEnableOption; + inherit (lib.types) int; cfg = config.modules.system.boot; in { options.modules.system.boot = { grub.enable = mkEnableOption "Grub, a bloated boot loader"; systemd-boot.enable = mkEnableOption "Poetteringboot"; + timeout = mkOption { + description = '' + Set the boot loader's timeout. This is 0 by default, but preferably longer on remote servers to make switching to previous generations easier. + ''; + type = int; + default = 0; + }; }; config = { assertions = [ @@ -33,7 +41,7 @@ in { loader = { efi.canTouchEfiVariables = true; # I love spamming space - timeout = 0; + timeout = cfg.timeout; systemd-boot = { enable = cfg.systemd-boot.enable; editor = mkForce false;