nichts/modules/system/boot/lanzaboote.mod.nix

35 lines
789 B
Nix
Raw Normal View History

2025-04-06 22:09:17 +02:00
{
config,
lib,
pkgs,
sources,
2025-04-06 22:09:17 +02:00
...
}: let
inherit (lib.modules) mkIf;
2025-05-17 23:45:38 +02:00
inherit (lib.options) mkEnableOption;
cfg = config.modules.system.boot.lanzaboote;
2025-04-06 22:09:17 +02:00
in {
2025-05-17 23:45:38 +02:00
options.modules.system.boot.lanzaboote.enable = mkEnableOption "Lanzaboote";
2025-04-06 22:09:17 +02:00
imports = [
(sources.lanzaboote + "/nix/modules/lanzaboote.nix")
2025-04-06 22:09:17 +02:00
];
2025-05-17 23:45:38 +02:00
config = mkIf cfg.enable {
2025-04-06 22:09:17 +02:00
boot = {
lanzaboote = {
enable = true;
pkiBundle = "/var/lib/sbctl";
};
# Lanzaboote currently replaces the systemd-boot module.
# This setting is usually set to true in configuration.nix
# generated at installation time. So we force it to false
# for now.
loader.systemd-boot.enable = lib.mkForce false;
};
environment.systemPackages = [pkgs.sbctl];
};
}