feat(boot): systemd-boot and lanzaboote toggles
Secure boot is not applicable in every use case.
This commit is contained in:
parent
61db72b9ab
commit
ba8cd0d40b
28
faucet/boot/default.nix
Normal file
28
faucet/boot/default.nix
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
{ pkgs
|
||||||
|
, lib
|
||||||
|
, config
|
||||||
|
, ... }: with lib; let
|
||||||
|
cfg = config.faucet.boot;
|
||||||
|
in {
|
||||||
|
options.faucet.boot = {
|
||||||
|
enable = mkEnableOption "bootloader installation and maintenance" // { default = true; };
|
||||||
|
systemd-boot = mkEnableOption "generation selection via systemd-boot" // { default = !cfg.lanzaboote; };
|
||||||
|
lanzaboote = mkEnableOption "secure boot maintenance via lanzaboote";
|
||||||
|
};
|
||||||
|
|
||||||
|
config = let
|
||||||
|
sbPath = "/nix/persist/lanzaboote";
|
||||||
|
in mkIf cfg.enable {
|
||||||
|
boot = {
|
||||||
|
initrd.systemd.enable = true;
|
||||||
|
lanzaboote.enable = cfg.lanzaboote;
|
||||||
|
lanzaboote.pkiBundle = sbPath;
|
||||||
|
loader.systemd-boot.enable = cfg.systemd-boot;
|
||||||
|
loader.efi.canTouchEfiVariables = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
# symlink for sbctl
|
||||||
|
environment.etc.secureboot = mkIf cfg.lanzaboote { source = sbPath; };
|
||||||
|
#environment.systemPackages = optional cfg.lanzaboote pkgs.sbctl;
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in a new issue