mirror of
https://github.com/tuxdotrs/nix-config.git
synced 2026-06-17 02:06:32 +05:30
30 lines
633 B
Nix
30 lines
633 B
Nix
{
|
|
flake.modules.nixos.boot =
|
|
{ config, lib, ... }:
|
|
let
|
|
cfg = config.tnix.boot;
|
|
in
|
|
{
|
|
options.tnix.boot.legacy = {
|
|
enable = lib.mkEnableOption "legacy boot (GRUB) instead of systemd-boot";
|
|
};
|
|
|
|
config = lib.mkMerge [
|
|
{
|
|
boot.loader = {
|
|
timeout = 1;
|
|
efi.canTouchEfiVariables = true;
|
|
};
|
|
}
|
|
|
|
(lib.mkIf (!cfg.legacy.enable && !cfg.secure-boot.enable) {
|
|
boot.loader.systemd-boot.enable = true;
|
|
})
|
|
|
|
(lib.mkIf cfg.legacy.enable {
|
|
boot.loader.grub.enable = true;
|
|
})
|
|
];
|
|
};
|
|
}
|