nixdots/system/shared/boot/secure-boot.nix

29 lines
564 B
Nix
Raw Normal View History

2024-07-26 23:07:07 +00:00
{
config,
pkgs,
lib,
...
}: let
2024-04-12 16:25:26 +00:00
inherit (lib) mkIf;
2024-04-12 18:57:52 +00:00
cfg = config.myOptions.system.boot.secure-boot;
2024-04-12 16:25:26 +00:00
in {
2024-04-12 18:57:52 +00:00
config = mkIf cfg.enable {
2024-04-12 16:25:26 +00:00
# Secure Boot Key Manager
2024-07-26 23:07:07 +00:00
environment.systemPackages = [pkgs.sbctl];
2024-04-12 16:25:26 +00:00
# Persist the secure boot keys (for impermanence)
myOptions.system.impermanence.root.extraDirectories = [
"/etc/secureboot"
];
# Lanzaboote replaces systemd-boot
boot.loader.systemd-boot.enable = lib.mkForce false;
boot.lanzaboote = {
enable = true;
pkiBundle = "/etc/secureboot";
};
};
}