diff options
| author | Seth Flynn <[email protected]> | 2025-02-10 14:18:37 -0500 |
|---|---|---|
| committer | Seth Flynn <[email protected]> | 2025-02-10 20:26:23 -0500 |
| commit | 0b139c489c9984a740dc2bb391c6869214b91222 (patch) | |
| tree | f689fe3533baa08590873cbc4ce67768c09efccb /modules/nixos/mixins/lanzaboote.nix | |
| parent | 688b481cf189d27daad494d3cf5391c8c012ee84 (diff) | |
nixos/lanzaboote: create mixin
Diffstat (limited to 'modules/nixos/mixins/lanzaboote.nix')
| -rw-r--r-- | modules/nixos/mixins/lanzaboote.nix | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/modules/nixos/mixins/lanzaboote.nix b/modules/nixos/mixins/lanzaboote.nix new file mode 100644 index 0000000..c55fa19 --- /dev/null +++ b/modules/nixos/mixins/lanzaboote.nix @@ -0,0 +1,43 @@ +{ + config, + lib, + pkgs, + inputs, + ... +}: + +let + cfg = config.boot.lanzaboote; +in + +{ + imports = [ inputs.lanzaboote.nixosModules.lanzaboote ]; + + config = lib.mkMerge [ + { + boot.lanzaboote = { + pkiBundle = "/etc/secureboot"; + + settings = { + console-mode = "auto"; + editor = false; + timeout = 0; + }; + }; + } + + (lib.mkIf cfg.enable { + boot = { + initrd.systemd.enable = true; # For unlocking LUKS root with TPM2 + loader.systemd-boot.enable = lib.mkForce false; # Lanzaboote replaces this + }; + + environment.systemPackages = [ + # manual Lanzaboote maintenance (NOTE: I have not actually used this since ~2022) + pkgs.sbctl + # TODO: Is this actually required for using `tpm2-device=auto` to unlock LUKS volumes in initrd? Probably + pkgs.tpm2-tss + ]; + }) + ]; +} |
