28 lines
537 B
Nix
28 lines
537 B
Nix
{
|
|
config,
|
|
lib,
|
|
...
|
|
}:
|
|
let
|
|
ccfg = import ../config.nix;
|
|
cfg_path = "${ccfg.custom_config_key}".boot.grub;
|
|
cfg = config.${cfg_path};
|
|
in
|
|
{
|
|
options.${ccfg.custom_config_key}.boot.grub = {
|
|
enable = lib.mkEnableOption "Grub bootloader";
|
|
device = lib.mkOption {
|
|
type = lib.types.str;
|
|
default = "/dev/sda";
|
|
description = ''
|
|
The device to install GRUB on.
|
|
'';
|
|
};
|
|
};
|
|
config = lib.mkIf cfg.enable {
|
|
boot.loader.grub = {
|
|
enable = true;
|
|
device = cfg.device;
|
|
};
|
|
};
|
|
}
|