1
0
Fork 0
puter/common/secure-boot.nix
2025-05-30 22:59:10 +02:00

24 lines
553 B
Nix

{
self,
attrName,
config,
lib,
pkgs,
...
}:
let
inherit (config.age) secrets;
in
{
age.secrets.secure-boot.file = self + /secrets/secure-boot/${attrName}.tar.age;
system.activationScripts.secureboot =
let
target = config.boot.lanzaboote.pkiBundle;
in
''
rm --recursive --force -- ${lib.escapeShellArg target}
mkdir --parents -- ${lib.escapeShellArg target}
${lib.getExe pkgs.gnutar} --extract --file ${lib.escapeShellArg secrets.secure-boot.path} --directory ${lib.escapeShellArg target}
'';
}