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

39 lines
910 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
2025-04-06 22:09:17 +02:00
inherit (lib.modules) mkIf;
2025-05-17 23:45:38 +02:00
inherit (lib.options) mkEnableOption;
cfg = config.modules.system.boot.lanzaboote;
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 = [
(import sources.flake-compat {
src = sources.lanzaboote;
copySourceTreeToStore = false;
useBuiltinsFetchTree = true;
}).outputs.nixosModules.lanzaboote
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];
2025-04-06 22:09:17 +02:00
};
}