at master 904 B view raw
1{ 2 config, 3 lib, 4 pkgs, 5 ... 6}: 7 8with lib; 9 10let 11 cfg = config.boot.loader.external; 12in 13{ 14 meta = { 15 maintainers = with maintainers; [ 16 cole-h 17 grahamc 18 raitobezarius 19 ]; 20 doc = ./external.md; 21 }; 22 23 options.boot.loader.external = { 24 enable = mkEnableOption "using an external tool to install your bootloader"; 25 26 installHook = mkOption { 27 type = with types; path; 28 description = '' 29 The full path to a program of your choosing which performs the bootloader installation process. 30 31 The program will be called with an argument pointing to the output of the system's toplevel. 32 ''; 33 }; 34 }; 35 36 config = mkIf cfg.enable { 37 boot.loader = { 38 grub.enable = mkDefault false; 39 systemd-boot.enable = mkDefault false; 40 supportsInitrdSecrets = mkDefault false; 41 }; 42 43 system.build.installBootLoader = cfg.installHook; 44 }; 45}