2021-08-05 19:33:13 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
cfg = config.boot.loader.external;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
meta = {
|
2022-11-30 16:56:16 +00:00
|
|
|
maintainers = with maintainers; [ cole-h grahamc raitobezarius ];
|
2023-01-24 23:33:40 +00:00
|
|
|
doc = ./external.md;
|
2021-08-05 19:33:13 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
options.boot.loader.external = {
|
2023-10-18 20:59:26 +00:00
|
|
|
enable = mkEnableOption (lib.mdDoc "using an external tool to install your bootloader");
|
2021-08-05 19:33:13 +00:00
|
|
|
|
|
|
|
installHook = mkOption {
|
|
|
|
type = with types; path;
|
2022-12-02 00:21:46 +00:00
|
|
|
description = lib.mdDoc ''
|
2021-08-05 19:33:13 +00:00
|
|
|
The full path to a program of your choosing which performs the bootloader installation process.
|
|
|
|
|
|
|
|
The program will be called with an argument pointing to the output of the system's toplevel.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
boot.loader = {
|
|
|
|
grub.enable = mkDefault false;
|
|
|
|
systemd-boot.enable = mkDefault false;
|
2022-11-30 16:56:16 +00:00
|
|
|
supportsInitrdSecrets = mkDefault false;
|
2021-08-05 19:33:13 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
system.build.installBootLoader = cfg.installHook;
|
|
|
|
};
|
|
|
|
}
|