puzzlevision/modules/nixos/common/grub/default.nix

33 lines
575 B
Nix
Raw Permalink Normal View History

{
lib,
namespace,
config,
...
}:
let
inherit (lib) mkEnableOption mkIf;
cfg = config.${namespace}.common.grub;
in {
options.${namespace}.common.grub = { enable = mkEnableOption "grub"; };
config = mkIf cfg.enable {
boot.loader.systemd-boot.enable = false;
boot.loader.grub = {
enable = true;
devices = [ "nodev" ];
efiInstallAsRemovable = true;
efiSupport = true;
extraEntries = ''
menuentry "Reboot" {
reboot
}
menuentry "Poweroff" {
halt
}
'';
};
2024-09-06 17:53:13 +02:00
};
}