32 lines
610 B
Nix
32 lines
610 B
Nix
{
|
|
pkgs,
|
|
inputs,
|
|
config,
|
|
lib,
|
|
...
|
|
}: let
|
|
cfg = config.system.secure_boot;
|
|
in {
|
|
options.system.secure_boot = {
|
|
enable = lib.mkEnableOption "enables secureboot with lanzaboote";
|
|
};
|
|
|
|
imports = [inputs.lanzaboote.nixosModules.lanzaboote];
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
|
|
# install userspace secureboot tools
|
|
environment.systemPackages = with pkgs; [
|
|
sbctl
|
|
];
|
|
|
|
# force disable systemd-boot so lanzaboote can be used
|
|
boot.loader.systemd-boot.enable = lib.mkForce false;
|
|
|
|
boot.lanzaboote = {
|
|
enable = true;
|
|
pkiBundle = "/var/lib/sbctl";
|
|
};
|
|
};
|
|
}
|